<html><head></head><body>Thanks all for your detailed responses. I will just monitor the NFS host.<br>
<br>
<br>
On Apr 1, 2015, at 6:41 PM, Malcolm <fragbaitmm@gmail.com> wrote:<br>
<br>
At my work, my team developed some "safe" coding to list NFS filesystems in df.<br>
It uses the showmount command to list exports on the NFS server - if this succeeds, it should be safe to run df on the filesystem.<br>
<br>
The comment in the code references the URL http://osdir.com/ml/monitoring.hobbit/2007/msg02373.html but it doesn't seem to exist now.<br>
<br>
It's ugly and no doubt could be cleaned up and improved...<br>
but it does work, and it's handy to know which clients are affected when a NFS volume becomes full.<br>
<br>
Update to xymonclient-linux.sh :<br>
================================<br>
At the end of the code for "df", add these lines :<br>
<br>
# --- Start - Addition code, to check nfs mounts ---<br>
# Added following code, based on http://osdir.com/ml/monitoring.hobbit/2007/msg02373.html<br>
#<br>
/bin/bash -c "/bin/egrep $'[ \t]nfs[ \t]' /etc/mtab" | \<br>
 /bin/egrep -v "ignore|indirect" | \<br>
 /usr/bin/awk '{print $1, $2}' | \<br>
 while read line<br>
 do<br>
 set -- $line<br>
   NFSHOST=`echo $1 | /usr/bin/awk -F: '{print $1}'`<br>
   SHARE=`echo $1   | /usr/bin/awk -F: '{print $2}'`<br>
   /bin/ping $NFSHOST -c 5 >/dev/null 2>&1<br>
   if [ $? -ne 0 ]<br>
   then<br>
     echo "$1 IS NOT RESPONDING(ping_failed) 999% $2"<br>
   else<br>
     # Ensure NFS connection is active BEFORE running the "showmount -e" command.<br>
     /bin/df -k $2 > /dev/null 2>&1 & /bin/sleep 5 ; kill $! > /dev/null 2>&1<br>
     /usr/sbin/showmount -e $NFSHOST >/dev/null 2>&1<br>
     if [ $? -ne 0 ]; then<br>
       echo "$1 IS NOT AVAILABLE(showmount_failed) 999% $2"<br>
     else<br>
       /usr/sbin/showmount -e $NFSHOST | /bin/egrep "^$SHARE " >/dev/null 2>&1<br>
       if [ $? -ne 0 ]; then<br>
         # Remove "/share" prefix as required for QNAP NFS servers<br>
         SHARE1=${SHARE#/share}<br>
         /usr/sbin/showmount -e $NFSHOST | /bin/egrep "^$SHARE1 " >/dev/null 2>&1<br>
       fi<br>
       if [ $? -ne 0 ]; then<br>
         echo "$1 IS NOT AVAILABLE(showmount_failed_to_find_share) 999% $2"<br>
       else<br>
         /bin/df -kP $2 | tail -n +2<br>
       fi<br>
     fi<br>
   fi<br>
 done<br>
# --- End of - Addition code, to check nfs mounts ---<br>
<br>
<br>
Regards<br>
Mal<br>
<br>
On 02/04/15 07:13, Henrik Størner wrote:<br>
Den 31-03-2015 kl. 00:49 skrev Paul Grondahl:<br>
On several systems with NFS mounts, the mounted volumes are not<br>
included in the disk utilization graphs. The volumes are visible in<br>
the client data. How does one get them included in the graphs?<br>
There is a potential problem with including network disks in the "disk"<br>
status: If your network connection to the NFS server dies, then the "df"<br>
command is likely to stall. So you won't get any client data sent over<br>
to the Xymon server, and your entire server goes purple.<br>
<br>
That is why the Xymon client uses the "-l" (local) flag for df to NOT<br>
report on network filesystems.<br>
<br>
<br>
Regards,<br>
Henrik<br>
<br>
_______________________________________________<br>
Xymon mailing list<br>
Xymon@xymon.com<br>
http://lists.xymon.com/mailman/listinfo/xymon<br>
<br>
<br>
_______________________________________________<br>
Xymon mailing list<br>
Xymon@xymon.com<br>
http://lists.xymon.com/mailman/listinfo/xymon<br>
<br>

<img src="http://t.signaleuna.com/e1t/o/5/f18dQhb0S7ks8dDMPbW2n0x6l2B9gXrN7sKj6v4LR2lW5v0Dkd1qg6y0W3MhxYF3LvrVvW54s08m1k1H6H0?si=6599060455161856&pi=A2F86E06-C0C3-4DC4-BF87-34598F14253D" width="1" height="1" style="display:none!important"></body></html>