[hobbit] Changing the frequency for individual tests

Henrik Stoerner henrik at hswn.dk
Tue Feb 15 23:20:35 CET 2005


Just going through my mail and answering those I have missed ...

On Tue, Feb 08, 2005 at 11:44:16AM -0500, kevin grady wrote:
> I have read through all of the documentation and I wanted to get
> clarification on network tests. Is there a way in hobbit to change the
> frequency of tests for hosts? Example, I ftp and http tests running
> against myhost.mydomain.com, can I have the http test run every 60
> seconds because that's where we make money and run the ftp service
> check every 5 minutes because it is less critical.

There is a way to do that, but it isn't obvious - and it works on a
per-host basis, not per-test.

You use the "NET:bla" tag in bb-hosts to split your hosts into the
important ones and the less important ones. Then you run two [bbnet]
tasks with different intervals, one runs every minute and handles the
important hosts, the other runs with the default interval (every 5
minutes) and handles the less critical hosts.

E.g. you have three hosts in bb-hosts: www.foo.com is important, the
other are not:

10.0.0.1  www.foo.com  # NET:critical ftp http://www.foo.com/
10.0.0.2  mail.foo.com # smtp
10.0.0.3  ns.foo.com   # dns

(You could have "NET:standard on the non-important hosts, but
 I'll leave that out because there is an easier way to pick those
 that have no NET definition).

In hobbitlaunch.cfg, you change the default [bbnet] definition into
two - one for each set of tests, with different intervals:

[bbnet-critical]
        ENVFILE /usr/local/hobbit/server/etc/hobbitserver.cfg
        NEEDS hobbitd
        CMD $BBHOME/bin/bb-network.sh critical
        LOGFILE $BBSERVERLOGS/bb-network.log
        INTERVAL 1m

[bbnet-standard]
        ENVFILE /usr/local/hobbit/server/etc/hobbitserver.cfg
        NEEDS hobbitd
        CMD $BBHOME/bin/bb-network.sh standard
        LOGFILE $BBSERVERLOGS/bb-network.log
        INTERVAL 5m


The CMD setting points at a shell script, because you need to change
the BBLOCATION environment variable before running the network test
tool. So $BBHOME/bin/bb-network.sh would look like this:

#!/bin/sh

BBLOCATION="$1"		# "critical" or "standard"
export BBLOCATION

if [ "$BBLOCATION" = "standard" ]; then
   # The "--test-untagged" makes it pick up those hosts with
   # no NET:xxx definition.
   exec bbtest-net --ping --checkresponse --test-untagged --report=netstd
else
   exec bbtest-net --ping --checkresponse --report=netcrit
fi


Regards,
Henrik



More information about the Xymon mailing list