Hi,
I ve written a simple script for checking if a NFS server is mounted or not. But even if I manually switch it off, it is still not detecting that the server is not mounted.
the script -
Code:
if grep -i "192.168.2.7" /proc/mounts > /dev/null 2>&1 ; then
echo "It is mounted on $HOSTNAME ,as on $DATE" >> test_pingtwo.log
else
echo "DATAMAN is not mounted on $HOSTNAME, as on $DATE, Please verify" | mail -s "Not Mounted" "producttesting@spire2grow.com" < /opt/s2g/scripts/test_pingtwo.log
fi
When the nfs was switched off the /proc/mounts still had the entry of 192.168.2.7! How to refresh this ? Isnt it supposed to refresh automatically?
This is the line present in /proc/mounts -
Code:
192.168.2.7:/DataVolume/app_bkp /data/app_bkp nfs rw,vers=3,rsize=16384,wsize=16384,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=192.168.2.7 0 0