Xymon Mailing List Archive search

Different timeouts per HTTP check

9 messages in this thread

list Wouter Schoot · Wed, 29 Apr 2009 09:37:59 +0200 ·
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?

Best regards,

Wouter
list Ralph Mitchell · Wed, 29 Apr 2009 13:15:29 -0500 ·
quoted from Wouter Schoot
On Wed, Apr 29, 2009 at 2:37 AM, Wouter Schoot <user-845758e8652b@xymon.invalid> 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
list Josh Luthman · Wed, 29 Apr 2009 14:33:06 -0400 ·
I'm graphing the output of server-status.  Very good information!

Josh Luthman
Office: XXX-XXX-XXXX
Direct: XXX-XXX-XXXX
XXXX Wayne St
Suite XXXX
Troy, OH XXXXX

Those who don't understand UNIX are condemned to reinvent it, poorly.
--- Henry Spencer
quoted from Ralph Mitchell


On Wed, Apr 29, 2009 at 2:15 PM, Ralph Mitchell <user-00a5e44c48c0@xymon.invalid>wrote:
On Wed, Apr 29, 2009 at 2:37 AM, Wouter Schoot <user-845758e8652b@xymon.invalid> 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

list Larry Barber · Wed, 29 Apr 2009 13:56:09 -0500 ·
You can use the "NET:" keyword (see the bb-hosts man page) to set up an
alternate network check. In the stanza within hobbitlaunch.cfg that launches
the bbtest-net that is associated with the new set of network checks you can
set an alternate timeout.

Thanks,
Larry Barber
quoted from Wouter Schoot

On Wed, Apr 29, 2009 at 2:37 AM, Wouter Schoot <user-845758e8652b@xymon.invalid> 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?

Best regards,

Wouter

list Ralph Mitchell · Wed, 29 Apr 2009 13:56:40 -0500 ·
It gets better - check out the "-w" option for curl.  You can get back the
actual amount of time taken to set up the connection and several other
things.
Ralph Mitchell


On Wed, Apr 29, 2009 at 1:33 PM, Josh Luthman
quoted from Josh Luthman
<user-4c45a83f15cb@xymon.invalid>wrote:
I'm graphing the output of server-status.  Very good information!

Josh Luthman
Office: XXX-XXX-XXXX
Direct: XXX-XXX-XXXX
XXXX Wayne St
Suite XXXX
Troy, OH XXXXX

Those who don't understand UNIX are condemned to reinvent it, poorly.
--- Henry Spencer


On Wed, Apr 29, 2009 at 2:15 PM, Ralph Mitchell <user-00a5e44c48c0@xymon.invalid>wrote:
On Wed, Apr 29, 2009 at 2:37 AM, Wouter Schoot <user-845758e8652b@xymon.invalid> 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

list Ralph Mitchell · Wed, 29 Apr 2009 14:10:01 -0500 ·
Unless something changed recently, the NET keyword allows you to specify
which of several Hobbit/Xymon servers performs network checks for a given
host.  I don't think it would do what the original poster wanted.
quoted from Ralph Mitchell
Ralph Mitchell


On Wed, Apr 29, 2009 at 1:56 PM, Larry Barber <user-6ef9c2864140@xymon.invalid> wrote:
You can use the "NET:" keyword (see the bb-hosts man page) to set up an
alternate network check. In the stanza within hobbitlaunch.cfg that launches
the bbtest-net that is associated with the new set of network checks you can
set an alternate timeout.

Thanks,
Larry Barber

On Wed, Apr 29, 2009 at 2:37 AM, Wouter Schoot <user-845758e8652b@xymon.invalid> 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?

Best regards,

Wouter

list Larry Barber · Wed, 29 Apr 2009 14:24:24 -0500 ·
Using NET: the way I specified works fine, I have a similar situation, a few
very slow web pages that tend to time out with the default settings, and
that is how I handle the problem. I just use NET: to specify a different
instance of bbtest-net, one with a longer timeout.
quoted from Ralph Mitchell

Thanks,
Larry Barber

On Wed, Apr 29, 2009 at 2:10 PM, Ralph Mitchell <user-00a5e44c48c0@xymon.invalid>wrote:
Unless something changed recently, the NET keyword allows you to specify
which of several Hobbit/Xymon servers performs network checks for a given
host.  I don't think it would do what the original poster wanted.
Ralph Mitchell


On Wed, Apr 29, 2009 at 1:56 PM, Larry Barber <user-6ef9c2864140@xymon.invalid> wrote:
You can use the "NET:" keyword (see the bb-hosts man page) to set up an
alternate network check. In the stanza within hobbitlaunch.cfg that launches
the bbtest-net that is associated with the new set of network checks you can
set an alternate timeout.

Thanks,
Larry Barber

On Wed, Apr 29, 2009 at 2:37 AM, Wouter Schoot <user-845758e8652b@xymon.invalid> 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?

Best regards,

Wouter

list Ralph Mitchell · Wed, 29 Apr 2009 14:39:20 -0500 ·
OK, cool.  I didn't think that would work.  This is on a single Xymon
server??  Are you setting BBLOCATION at all??
quoted from Larry Barber
Ralph Mitchell


On Wed, Apr 29, 2009 at 2:24 PM, Larry Barber <user-6ef9c2864140@xymon.invalid> wrote:
Using NET: the way I specified works fine, I have a similar situation, a
few very slow web pages that tend to time out with the default settings, and
that is how I handle the problem. I just use NET: to specify a different
instance of bbtest-net, one with a longer timeout.

Thanks,
Larry Barber


On Wed, Apr 29, 2009 at 2:10 PM, Ralph Mitchell <user-00a5e44c48c0@xymon.invalid>wrote:
Unless something changed recently, the NET keyword allows you to specify
which of several Hobbit/Xymon servers performs network checks for a given
host.  I don't think it would do what the original poster wanted.
Ralph Mitchell


On Wed, Apr 29, 2009 at 1:56 PM, Larry Barber <user-6ef9c2864140@xymon.invalid> wrote:
You can use the "NET:" keyword (see the bb-hosts man page) to set up an
alternate network check. In the stanza within hobbitlaunch.cfg that launches
the bbtest-net that is associated with the new set of network checks you can
set an alternate timeout.

Thanks,
Larry Barber

On Wed, Apr 29, 2009 at 2:37 AM, Wouter Schoot <user-845758e8652b@xymon.invalid>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?

Best regards,

Wouter

list Larry Barber · Wed, 29 Apr 2009 14:48:35 -0500 ·
Sure, you set BBLOCATION to the appropriate value for each instance of
bbtest-net. Here's the stanzas from hobbitlaunch:

[bbnet-midr]
    ENVFILE /usr/local/hobbit/server/etc/hobbitserver.cfg
    NEEDS hobbitd
    CMD BBPORT=1984 BBLOCATION=MIDR bbtest-net --report --ping
--checkresponse --concurrency=128 --timeout=15 --test-untagged
    LOGFILE $BBSERVERLOGS/bb-network-midr.log
    INTERVAL 2m

[bbnet-midr-lf]
    ENVFILE /usr/local/hobbit/server/etc/hobbitserver.cfg
    NEEDS hobbitd
    CMD BBPORT=1984 BBLOCATION=MIDRLF bbtest-net --report=bbtest-mdrlf
--ping --checkresponse --concurrency=128 --timeout=15 --frequenttestlimit=0
    LOGFILE $BBSERVERLOGS/bb-network-midrlf.log
    INTERVAL 10m

I also see that I misstated what I was doing before, the problem was that
some of our customers were complaining about how often Hobbit was hitting
their site (like checking something every two minutes was going to destroy
their site) so I created a separate bbtest-net instance that only ran every
10 minutes instead of every 2 minutes. But the same idea could be used to
give a longer timeout if necessary, just change the --timeout argument to
bbtest-net.
quoted from Ralph Mitchell

Thanks,
Larry Barber


On Wed, Apr 29, 2009 at 2:39 PM, Ralph Mitchell <user-00a5e44c48c0@xymon.invalid>wrote:
OK, cool.  I didn't think that would work.  This is on a single Xymon
server??  Are you setting BBLOCATION at all??
Ralph Mitchell


On Wed, Apr 29, 2009 at 2:24 PM, Larry Barber <user-6ef9c2864140@xymon.invalid> wrote:
Using NET: the way I specified works fine, I have a similar situation, a
few very slow web pages that tend to time out with the default settings, and
that is how I handle the problem. I just use NET: to specify a different
instance of bbtest-net, one with a longer timeout.

Thanks,
Larry Barber


On Wed, Apr 29, 2009 at 2:10 PM, Ralph Mitchell <user-00a5e44c48c0@xymon.invalid>wrote:
Unless something changed recently, the NET keyword allows you to specify
which of several Hobbit/Xymon servers performs network checks for a given
host.  I don't think it would do what the original poster wanted.
Ralph Mitchell


On Wed, Apr 29, 2009 at 1:56 PM, Larry Barber <user-6ef9c2864140@xymon.invalid>wrote:
You can use the "NET:" keyword (see the bb-hosts man page) to set up an
alternate network check. In the stanza within hobbitlaunch.cfg that launches
the bbtest-net that is associated with the new set of network checks you can
set an alternate timeout.

Thanks,
Larry Barber

On Wed, Apr 29, 2009 at 2:37 AM, Wouter Schoot <user-845758e8652b@xymon.invalid>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?

Best regards,

Wouter