[hobbit] randomizing execution of tests

Ralph Mitchell ralphmitchell at gmail.com
Sat Feb 7 04:29:25 CET 2009


On Fri, Feb 6, 2009 at 4:45 PM, Asif Iqbal <vadud3 at gmail.com> wrote:

> On Fri, Feb 6, 2009 at 3:48 PM, Ralph Mitchell <ralphmitchell at gmail.com>
> wrote:
> > I don't think that's possible with Xymon right now, but it can be done if
> > you're up to a little scripting.  I had an aging, single 733MHz cpu DL380
> > running web page checkouts on 400+ hosts, generating around 2700 reports,
> > running at various intervals from 30 seconds to 24 hours.
> >
> > The trick is to use cron for scheduling...
> >
> > Something like this, for instance:
> >
> > ============= cut here ============
> > #!/bin/sh
> >
> > TESTHOST=www.google.com
> > TESTURL=http://$TESTHOST/
> >
> > TIMEOUT=30
> >
> > # Grab *just* the headers, simulating Xymon's builtin http check
> > MESSAGE=`curl -m $TIMEOUT \
> >      -w 'Seconds:     %{time_total}\n' \
> >      -s -S -L -I $TESTURL | $GREP -v Set-Cookie`
> > if [ "$?" -eq "0" ]; then
> >   COLOR=green
> > else
> >   COLOR=red
> > fi
> >
> > # convert dots to commas in the hostname
> > MACHINE=`echo $TESTHOST | $SED -e 's/\./\,/g'
> >
> > $BB $BBDISP "status $MACHINE.home $COLOR `date`
> >
> > $MESSAGE"
> > ============= cut here ============
>
> This curl command looks all I need as an extension script instead of
> http:// to get my host specific http timeout
>
> I could just use this instead of urlplus.pl, correct?
>

Yes, you could do exactly that.  You'll probably want to make the above
script into a function or child script and feed it the hostname, url & max
time values pulled from a file.

Ralph Mitchell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20090206/616d67c6/attachment.html>


More information about the Xymon mailing list