[hobbit] Different timeouts per HTTP check

Ralph Mitchell ralphmitchell at gmail.com
Wed Apr 29 20:15:29 CEST 2009


On Wed, Apr 29, 2009 at 2:37 AM, Wouter Schoot <wouter at schoot.org> wrote:

> Hi,
>
> I'm using a few HTTP checks to see how fast (and if) a website responds.
> However, some are known to be slower than others and I want therefor some
> sites not to trigger an alert or at least not if it doesn't respond in 10
> seconds, but for instance 20 seconds. How can I achieve this for 1 check,
> not globally for all HTTP checks?


I don't think you can do that at present, not with the builtin HTTP check.
 On the other hand, an external script can do whatever you can dream up.
 Here's something similar to what I set up for about 2500 web server checks:

Parent script:

   #!/bin/bash
   /home/hobbit/server/ext/bb-url.sh 10 server1.domain.com
   /home/hobbit/server/ext/bb-url.sh 20 server2.domain.com
   ..... etc.....


Child script:

   #!/bin/bash
   curl -s -S -L -m $1 -o /dev/null http://$2
   if [ "$?" -ne "0" ]; then
      COLOR=red
      MESSAGE="something bad happened: url=http://$2"
   else
      COLOR=green
      MESSAGE="everything is ok: url=http://$2"
   fi
   $BB $BBDISP "status $2.http $COLOR `date`
$MESSAGE"


Obviously that can get a lot more complicated.  You'd need to kick off the
parent script by adding a section to the server/etc/hobbitlaunch.cfg file.
 Or you could do what I did and have the parent script run by cron, which
makes it easier to schedule the checks to run at specific times.

Ralph Mitchell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20090429/5cc59d2f/attachment.html>


More information about the Xymon mailing list