Any docs on how to write tests?
Looking for a way to write tests that check a URL, and return fail/pass depending on the content.
I could easily use curl to do this, but I'm looking for information on how to integrate the curl command line into xymon as a test.
So far as I can see, the bb-services file only accepts test definitions by port, but I may be missing something.
Thanks in advance!
-Bobby
On 19-08-2011 21:31, J. Bobby Lopez wrote:
Looking for a way to write tests that check a URL, and return fail/pass depending on the content.
I could easily use curl to do this, but I'm looking for information on how to integrate the curl command line into xymon as a test.
Re-inventing the wheel, eh ?
Try reading up on the "cont" style test (see the hosts.cfg(5) man-page).
Regards, Henrik
I have some systems running Xymon 4.2.3, I'm guessing the 'cont' attribute, along with hosts.cfg are not available in that version?
On Fri, Aug 19, 2011 at 4:28 PM, Henrik Størner <henrik at hswn.dk> wrote:
On 19-08-2011 21:31, J. Bobby Lopez wrote:
Looking for a way to write tests that check a URL, and return fail/pass depending on the content.
I could easily use curl to do this, but I'm looking for information on how to integrate the curl command line into xymon as a test.
Re-inventing the wheel, eh ?
Try reading up on the "cont" style test (see the hosts.cfg(5) man-page).
Regards, Henrik
Xymon mailing list Xymon at xymon.com http://lists.xymon.com/mailman/listinfo/xymon
sounds like I'll be upgrading soon. Thanks Henrik.
On Fri, Aug 19, 2011 at 4:53 PM, J. Bobby Lopez <jbl at jbldata.com> wrote:
I have some systems running Xymon 4.2.3, I'm guessing the 'cont' attribute, along with hosts.cfg are not available in that version?
On Fri, Aug 19, 2011 at 4:28 PM, Henrik Størner <henrik at hswn.dk> wrote:
On 19-08-2011 21:31, J. Bobby Lopez wrote:
Looking for a way to write tests that check a URL, and return fail/pass depending on the content.
I could easily use curl to do this, but I'm looking for information on how to integrate the curl command line into xymon as a test.
Re-inventing the wheel, eh ?
Try reading up on the "cont" style test (see the hosts.cfg(5) man-page).
Regards, Henrik
Xymon mailing list Xymon at xymon.com http://lists.xymon.com/mailman/listinfo/xymon
It's not too hard to script url tests. Below is one I wrote to check an RSA key server appliance. You can have xymon kick it off for you by adding something like this to server/etc/hobbitlaunch.cfg:
[keysrv] ENVFILE /home/xymon/server/etc/xymonserver.cfg NEEDS xymond CMD /home/xymon/server/ext/rkmsrv.sh LOGFILE $XYMONSERVERLOGS/rkmsrv.log INTERVAL 5m
Obviously you can do substantially more complicated things than would be possible in the regular "cont" check.
Ralph Mitchell
#!/bin/sh
set -x
TESTHOST=rkm.example.com TESTMSG='Get Key Successful' OUTFILE=$BBTMP/rkm.html
rm -f $OUTFILE
TIME=curl -s -S -L -m 30 -w '%{time_total}' \ --cacert $BBHOME/trusted_cas.pem \ -o $OUTFILE \ "https:// $TESTHOST/rkmawa/healthCheck.do?keyclass=xymon&rootca=/root/CA/demoCA/trusted_cas. pem&client=/root/CA/demoCA/certs/xymon.p12"
STATUS=grep -c 'Get Key Successful' $BBTMP/rkm.html
if [ "$STATUS" -eq "1" ]; then
COLOR=green
MESSAGE="Found <b>$TESTMSG</b>. Key server looks OK"
else
COLOR=red
MESSAGE="Failed to find <b>$TESTMSG</b>. Key server may be in trouble"
fi
MESSAGE="$MESSAGE
<pre>
cat $BBTMP/rkm.html
</pre>
<p>
Query: $TIME secs"
cat $BBTMP/rkm.html | sed -e 's/:/%3A/g'
MACHINE=echo $TESTHOST | sed -e 's/\./\,/g'
$BB $BBDISP "status $MACHINE.keysrv $COLOR date
$MESSAGE" exit 0
==========================================
On Fri, Aug 19, 2011 at 5:17 PM, J. Bobby Lopez <jbl at jbldata.com> wrote:
sounds like I'll be upgrading soon. Thanks Henrik.
On Fri, Aug 19, 2011 at 4:53 PM, J. Bobby Lopez <jbl at jbldata.com> wrote:
I have some systems running Xymon 4.2.3, I'm guessing the 'cont' attribute, along with hosts.cfg are not available in that version?
On Fri, Aug 19, 2011 at 4:28 PM, Henrik Størner <henrik at hswn.dk> wrote:
On 19-08-2011 21:31, J. Bobby Lopez wrote:
Looking for a way to write tests that check a URL, and return fail/pass depending on the content.
I could easily use curl to do this, but I'm looking for information on how to integrate the curl command line into xymon as a test.
Re-inventing the wheel, eh ?
Try reading up on the "cont" style test (see the hosts.cfg(5) man-page).
Regards, Henrik
Xymon mailing list Xymon at xymon.com http://lists.xymon.com/mailman/listinfo/xymon
Xymon mailing list Xymon at xymon.com http://lists.xymon.com/mailman/listinfo/xymon
On 19-08-2011 22:53, J. Bobby Lopez wrote:
I have some systems running Xymon 4.2.3, I'm guessing the 'cont' attribute, along with hosts.cfg are not available in that version?
content-checks have been in Xymon / Hobbit / bbgen since version 2.0 (released in early 2003).
Regards, Henrik
participants (3)
-
henrik@hswn.dk
-
jbl@jbldata.com
-
ralphmitchell@gmail.com