File: //var/opt/OV/bin/instrumentation/readonly-lx-check.sh
#!/bin/bash
# This script send to OM Agent the fs that is mounted readonly
# Parameters: $1 Monitor Name
#
# Test only Linux Red Hat
monname=$1
if [ $# -ne 1 ]
then
echo "Requeired paramenter monitor name"
exit 1
fi
mounts=(`df -Pkhl -x tmpfs -x devtmpfs -x tmpfs -x iso9660 |sed '1d' | awk {'print $6'}`)
for disk in "${mounts[@]}"
do
diskstatus=(`cat /proc/mounts | grep $disk | awk {'print $4'}| cut -c1-2`)
if [ $diskstatus == "ro" ];
then
/opt/OV/bin/opcmon $monname=1 -object $disk
else
/opt/OV/bin/opcmon $monname=0 -object $disk
fi
done
exit 0