====== My Monitor (CHANGEME) ======
^ Author | [[ Brian.Scott@tafensw.edu.au | Brian Scott ]] |
^ Compatibility | Xymon 4.3 |
^ Requirements | FreeBSD, Bourne Shell (sh) |
^ Download | None |
^ Last Update | 2011-08-12 |
===== Description =====
===== Installation =====
The usual stuff for ~xymon/server/etc/tasks.cfg:
[gstripe]
ENVFILE /home/hobbit/server/etc/xymonserver.cfg
NEEDS xymond
CMD $XYMONHOME/ext/gstripe.sh
LOGFILE $XYMONSERVERLOGS/gstripe.log
INTERVAL 5m
And the equivalent version if client side.
===== Source =====
==== gstripe.sh ====
#!/bin/sh
COLUMN=gstripe
HOSTNAME="`hostname`"
COLOUR=green
# % gstripe status
# Name Status Components
# stripe/tmp UP ad8p5
# ad10p5
#stripe/work UP ad8p8
# ad10p8
# UP, DOWN -> green, red
/usr/bin/time -p gstripe status >$XYMONTMP/$COLUMN.out 2>&1
rc=$?
SECONDS=`egrep "^real" $XYMONTMP/${COLUMN}.out | awk '{printf $2}'`
if [ $rc -ne 0 ]; then
COLOUR=red
MSG="gstripe query failed
`cat $XYMONTMP/${COLUMN}.out|grep -v '^\(real\|user\|sys\)'`
Seconds: ${SECONDS}
"
else
grep ' DOWN ' $XYMONTMP/$COLUMN.out >/dev/null
if [ $? -eq 0 ]; then
COLOUR=red
fi
MSG="gstripe query succeeded
`cat $XYMONTMP/${COLUMN}.out|grep -v '^\(real\|user\|sys\)'`
Seconds: ${SECONDS}
"
fi
$XYMON $XYMSRV "status $HOSTNAME.$COLUMN $COLOUR `date`
$MSG"
$RM $XYMONTMP/${COLUMN}.out
exit 0
===== Known Bugs and Issues =====
It may very well be that a failure of a striped disk will bring the system down faster than we can usefully detect.
===== To Do =====
===== Credits =====
===== Changelog =====
* **2011-08-12**
* Initial release