[Xymon] Ext script not looping
Ricardo L.
rltexas1 at gmail.com
Wed Sep 24 16:00:51 CEST 2014
I have this script work is failing on all hosts except the first one.
I have narrowed it down to the ssh statement. For some reason the ssh statement causes the script to exit after the first host.
Any ideas why the ssh statement would cause the ext script to exit after the first host ?
#!/bin/sh
export PATH=$PATH:/sbin:/bin:/usr/bin:/usr/local/bin:/usr/sbin:/usr/local/bin
HOSTTAG=zfsmon # What we put in hosts.cfg to trigger this test
COLUMN=zfs # Name of the column, often same as tag in hosts.cfg
$XYMONHOME/bin/xymongrep $HOSTTAG | while read L
do
set $L # To get one line of output from xymongrep
HOSTIP="$1"
MACHINEDOTS="$2"
MACHINE=`echo $2 | $SED -e's/\./,/g'`
COLOR=green
MSG="&green $MACHINEDOTS : POOL OK "
#... do the test, perhaps modify COLOR and MSG
typeset ZFSSTAT=
ZFSHEALTH=`/usr/local/bin/ssh $MACHINE "/sbin/zpool get health rpool" | grep ONLINE | wc -l`
if [ $ZFSHEALTH -ne 1 ]
then
COLOR=red
MSG="&red $MACHINEDOTS : POOL ISSUE"
fi
ZFSSTAT=`ssh -q $MACHINE /sbin/zpool status rpool`
$XYMON $XYMSRV "status $MACHINE.$COLUMN $COLOR `date`
${MSG}
$ZFSSTAT
"
Done
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20140924/56c41fff/attachment.html>
More information about the Xymon
mailing list