[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [hobbit] randomizing execution of tests



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