[Xymon] Conn/Ping Test/Graph to Secondary (Backup) IP
Scott Driemeier-Showers
sshowers at negwer.com
Tue Dec 19 23:42:29 CET 2017
I have been attempting to use the “standard” tcp (conn) tests and pre-defined graphs, rather than building something “custom”.
In /etc/xymon/xymonserver.cfg I added:
TEST2RRD=” … ,voip=tcp”
GRAPHS=” … ,voip”
I did not configure it to use NCV as I understood, based on my reading online, that was only necessary with output formatted as colon-separated “columnar” data. Since this test runs a simple fping the output looks like this:
10.10.16.251 is alive (25.8 ms)
I rewrote the script yesterday as a shell script (no perl). Here’s the entire thing:
#!/bin/sh
COLUMN=voip
for RMT in `cat /etc/xymon/hosts.cfg | egrep "vya|tal" | tr -s ' ' | cut -d" " -f1,2 --output-delimiter=,`
do
ADDR=`echo $RMT | awk -F, '{print $1}'`
SITE=`echo $RMT | awk -F, '{print $2}'`
RSLT=ok
STAT=green
VOIP=${ADDR/192.168/10.10}
VOIP=${VOIP/.5./.6.}
SRVR=${SITE//./,}
DATA=`/usr/sbin/fping -Ae $VOIP`
if [[ $DATA == *"unreachable"* ]]
then
RSLT="NOT ok"
STAT=red
fi
MESG="Service $COLUMN on $SITE is $RSLT"
# Results to Xymon
#echo $ADDR $SRVR $DATA $STAT $MESG
$XYMON $XYMSRV "status $SRVR.$COLUMN $STAT `date +"%a %b %d %H:%M:%S %Y"` $COLUMN $RSLT
${MESG}
${DATA}
"
done
exit 0
Unfortunately no, the RRD log files are not being created either – so it looks like I’ve missed some critical steps there too.
Thanks,
Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20171219/fa75fc4f/attachment.html>
More information about the Xymon
mailing list