monitors:gstripe

Error loading plugin struct
ParseError: syntax error, unexpected 'fn' (T_STRING), expecting :: (T_PAAMAYIM_NEKUDOTAYIM)
More info is available in the error log.

My Monitor (CHANGEME)

Author Brian Scott
Compatibility Xymon 4.3
Requirements FreeBSD, Bourne Shell (sh)
Download None
Last Update 2011-08-12

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.

Show Code ⇲

Hide Code ⇱

#!/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

It may very well be that a failure of a striped disk will bring the system down faster than we can usefully detect.

  • 2011-08-12
    • Initial release
  • monitors/gstripe.txt
  • Last modified: 2011/08/12 04:44
  • by 127.0.0.1