[hobbit] NFS filesystem check on Hobbit client

Matthew Epp matthew.epp at us.army.mil
Fri Jun 15 00:28:07 CEST 2007


Oops I realized that the showmount command should be using -e, not -d. 
Also, I made a version for hobbitclient-linux.sh:

echo "[df]"
df -Pl -x none -x tmpfs -x shmfs -x unknown -x iso9660 | sed -e '/^[^ 
][^     ]*$/{
N
s/[     ]*\n[   ]*/ /
}'
/bin/egrep '[   ]nfs[   ]' /etc/mtab | /bin/egrep -v '[ 
,](ignore|indirect)[    ,]' | /usr/bin/awk '{print $1, $2}' | while read 
line
do
   set -- $line
   NFSHOST=`echo $1 | /usr/bin/awk -F: '{print $1}'`
   SHARE=`echo $1 | /usr/bin/awk -F: '{print $2}'`
   /bin/ping -c 1 $NFSHOST >/dev/null 2>&1
   if [ $? -ne 0 ]; then
     echo "$1 IS NOT RESPONDING(ping_failed) 999% $2"
   else
     /usr/sbin/showmount -e $NFSHOST >/dev/null 2>&1
     if [ $? -ne 0 ]; then
       echo "$1 IS NOT AVAILABLE(showmount_failed) 999% $2"
     else
       /usr/sbin/showmount -e $NFSHOST | egrep "^$SHARE " >/dev/null 2>&1
       if [ $? -ne 0 ]; then
         echo "$1 IS NOT AVAILABLE(showmount_failed_to_find_share) 999% $2"
       else
         /bin/df -k $2 | /bin/sed -e '/^[^       ][^     ]*$/{
N
s/[     ]*\n[   ]*/ /
}' | tail +2
       fi
     fi
   fi
done



More information about the Xymon mailing list