I'd like to monitor NFS mounts and the NFS server process using Monit.
On the server, I'd need a PID file, but I can't seem to find a way of getting that created with existing configuration files. Is there a way to do this, or has anyone monitored the server in a different way (checking if port 53 is active, etc).
On clients, I was thinking of making Monit simply look for a specific file in an NFS mount, and if it's accessible, all is well. Problem is, if the NFS server does go down, file requests usually hang (perhaps even indefinitely, not sure). How would one get around this issue with monit?
Any configuration examples would be greatly appreciated!
Best Answer
As for the "hanging" of the Monit process during NFS server faults, this can be circumvented by two methods.
hard
tosoft
, which causes the NFS layer to issue an I/O error to the accessing application afterretrans
retries. As this can introduce other problems with respect to data integrity (your writing applications need to be able to cope with I/O errors or at least exit cleanly, without corrupting the file written), you may also try to:Hope this helps!