Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

CentOS:

cat << 'EOL' >/usr/share/xymon-client/ext/nfs.sh
#!/bin/sh

COLUMN=nfs                             
COLOR=green                             
MSG="NFS Status"  

#In this test, if var = empty = RED
var="$(netstat -an | grep 2049 | grep "ESTABLISHED")"
cmd="$(netstat -an | grep 2049)"

if [ -z "$var" ] 

then

COLOR=red
MSG="${MSG}
FAILED
""
"${cmd}"
"
else

MSG="${MSG}
SUCCESS
""
"${cmd}"
"
fi

# Leave the rest of script alone
# Tell Xymon about it
$XYMON $XYMSRV "status $MACHINE.$COLUMN $COLOR `date`

${MSG}
"

exit 0
EOL


chown xymon:xymon /usr/share/xymon-client/ext/nfs.sh
chmod 777 /usr/share/xymon-client/ext/nfs.sh
 

cat << 'EOL' >/etc/xymon-client/client.d/nfs.cfg
[nfs]
 ENVFILE $XYMONCLIENTHOME/etc/xymonclient.cfg
 CMD $XYMONCLIENTHOME/ext/nfs.sh
 LOGFILE $XYMONCLIENTHOME/logs/nfs.log
 INTERVAL 15m
EOL
 
chown xymon:xymon /etc/xymon-client/client.d/nfs.cfg
chmod 777 /etc/xymon-client/client.d/nfs.cfg

/usr/share/xymon-client/bin/xymoncmd /usr/share/xymon-client/ext/nfs.sh

/etc/init.d/xymon-client restart
  • No labels