Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

CentOS 6:

 

No Format
$XYMONHOME=/usr/lib/xymon/
No Format
yum install -y smartmontools --no-install-recommends
No Format
sudo visudo
No Format
xymon   ALL=(ALL)     NOPASSWD:ALL
No Format
cat << 'EOL' >/usr/lib/xymon/client/ext/smart.sh
#!/bin/sh

COLUMN=smart                             
COLOR=green                             
MSG="smartctl -H /dev/sd# | grep OK" # The comamnd from var

#In this test, if var = empty = RED
var="$(sudo smartctl -H /dev/sda | grep OK)"
var1="$(sudo smartctl -H /dev/sdb | grep OK)"
cmd="$(sudo smartctl -H /dev/sda ; sudo smartctl -H /dev/sdb)"

if [ -z "$var" ] || [ -z "$var1" ] 

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/lib/xymon/client/ext/smart.sh
chmod 777 /usr/lib/xymon/client/ext/smart.sh
 

nano /usr/lib/xymon/client/etc/clientlaunch*cfg
No Format
[smart]
 ENVFILE $XYMONCLIENTHOME/etc/xymonclient.cfg
 CMD $XYMONCLIENTHOME/ext/smart.sh
 LOGFILE $XYMONCLIENTHOME/logs/smart.log
 INTERVAL 15m
No Format
/usr/lib/xymon/client/bin/xymoncmd /usr/lib/xymon/client/ext/smart.sh

/etc/init.d/xymon-client restart

 

CentOS 5:

Default $XYHOME home in CentOS 5 :

...