Operating System - HP-UX
1830900 Members
3359 Online
110017 Solutions
New Discussion

Re: NFS Client - need error messages

 
SOLVED
Go to solution
Ian Dennison_1
Honored Contributor

NFS Client - need error messages

I have a need to monitor when an NFS Client sees the relevant server go down (ie the mount point becomes unavailable).

Have tried this in 10.20 and 11.00 but cannot get any messages appearing in syslog.log or in dmesg.

Any ideas anyone? Ian
Building a dumber user
3 REPLIES 3
Stefan Farrelly
Honored Contributor
Solution

Re: NFS Client - need error messages

Even if the NFS server goes down youre not going to get an error unless someone/some program tries to acces it - then you get an NFS not repsonding error.

All I can think of is you write a monitor job which runs say every min or two and does a df/bdf | grep 2>&1
then grep -i "not responding". If the nfs server is down or not available you will get this error, then you can email or run logger to write something to syslog or whatever to raise the alarm.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Stanimir
Trusted Contributor

Re: NFS Client - need error messages

Hi!
Try something simple like:

/sbin/mount | grep / >/dev/null
if [ $? -eq 0 ]; then
echo "/ mounted"
else
/mount -F nfs server:/
if [ $? -eq 0 ]; then
echo "server1: mounted /"
else
echo "Cannot mount /"

# Program to notify by e-mail:
# notify.me $MYERRORCODE

exit 1
fi

Regards,stan
Ian Dennison_1
Honored Contributor

Re: NFS Client - need error messages

Magic answers, thanks!

Share and Enjoy! Ian
Building a dumber user