[hobbit] network testing tool for single host/service

Henrik Stoerner henrik at hswn.dk
Mon Mar 13 10:48:41 CET 2006


On Mon, Mar 13, 2006 at 09:11:45AM +0100, Dominique Frise wrote:
> 
> Using Big Brother for several years, we wrote quite a few custom 
> server/side scripts where we used bbnet tool from BB.
> This utility allowed us to test a single host/service pair on the command 
> line.
> 
> Example:
> 
> URL=http://test.example.com
> 
> $BBHOME/bin/bbnet $URL > $BBTMP/HTTP_$PROC$$
> 
> Your -definitely better- tool bbtest-net is bounded to $BBHOSTS and it does 
> not seem possible to test a single host/service like above.
> A hack could be to redefine $BBHOSTS with a single entry before calling 
> bbtest-net.
> I there another possibility to to this?

I don't understand what it is you're trying to do. If you've written
a script which essentially just checks a URL, then why can't you just
use the normal Hobbit network tester ?

Even if your script does some checking on the content of the data
it gets back, you should be able to do that just as easily with 
Hobbit's built-in content checks.

As Frederic wrote, you can test a single host with the Hobbit network
tester by passing the hostname on the command line. If you just want
to see the test result (without sending it to the Hobbit server), you
can run it as

   bbcmd bbtest-net --no-update my.host.name

The only reason I can think of, is if you want to check the results
of the network tests before putting them into the bb-hosts file.
This can be done with the following script:

#!/bin/sh
echo "0.0.0.0 testhost # noconn $*" >/tmp/bbh.tmp
bbcmd sh -c "BBHOSTS=/tmp/bbh.tmp BBTMP=/tmp bbtest-net --no-update testhost"
rm /tmp/bbh.tmp
exit 0

e.g. save it as check.sh, then run

    check.sh http://test.example.com/


Regards,
Henrik




More information about the Xymon mailing list