Xymon Mailing List Archive search

how to implement custom tests

6 messages in this thread

list Reif Jeffery M · Thu, 7 Jul 2005 15:27:35 -0500 ·
I installed Hobbit on my (former) BB server.  The clients are reporting
in normally.  However, I have some tests for hosts (NetApp, Tandem -
that have no BB client) that run on the BB server and use the bb
executable to "trick" the server into thinking it received it from an
external client.  For example:

exec("/opt/bb/bin/bb", $IP, "status $machine.$test $color $now\n 
$status\n 
@array\n 
")
  or die( "$1: Couldn't execute BB");


Is there an equivalent function on the Hobbit server that can accomplish
this without having both BB and Hobbit installed?
list Michael Lowery · Thu, 7 Jul 2005 15:31:34 -0500 ·
I'm assuming you'd still want a BB client on your Hobbit server, if not,
ignore... but you can still do those things in the ext folder on the BB
client piece and it should still report them to Hobbit as usual.  I have
a few scripts from BB server now running in my BB client in the same
manner.

Michael
quoted from Reif Jeffery M

-----Original Message-----
From: Reif Jeffery M [mailto:user-e9cc5d6c2490@xymon.invalid] 
Sent: Thursday, July 07, 2005 3:28 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] how to implement custom tests

I installed Hobbit on my (former) BB server.  The clients are reporting
in normally.  However, I have some tests for hosts (NetApp, Tandem -
that have no BB client) that run on the BB server and use the bb
executable to "trick" the server into thinking it received it from an
external client.  For example:

exec("/opt/bb/bin/bb", $IP, "status $machine.$test $color $now\n 
$status\n 
@array\n 
")
  or die( "$1: Couldn't execute BB");


Is there an equivalent function on the Hobbit server that can accomplish
this without having both BB and Hobbit installed?
list Henrik Størner · Thu, 7 Jul 2005 22:38:20 +0200 ·
quoted from Reif Jeffery M
On Thu, Jul 07, 2005 at 03:27:35PM -0500, Reif Jeffery M wrote:
I installed Hobbit on my (former) BB server.  The clients are reporting
in normally.  However, I have some tests for hosts (NetApp, Tandem -
that have no BB client) that run on the BB server and use the bb
executable to "trick" the server into thinking it received it from an
external client.  For example:

exec("/opt/bb/bin/bb", $IP, "status $machine.$test $color $now\n 
$status\n 
@array\n 
")
  or die( "$1: Couldn't execute BB");


Is there an equivalent function on the Hobbit server that can accomplish
this without having both BB and Hobbit installed?
Hobbit comes with a "bb" binary that acts just like the Big Brother one.
So your script should work just fine, although you may need to change
that hard-coded path to /opt/bb/bin/bb (or setup links).


Regards,
Henrik
list Larry Barber · Thu, 7 Jul 2005 16:42:42 -0400 (EDT) ·
The hobbit 'bb' program in the $BBHOME/server/bin directory behaves the
same as the BigBrother bb program. You should just need to change the
directories in your scripts to make them work.

Thanks,
Larry Barber
quoted from Henrik Størner


On Thu, 2005-07-07 at 15:27 -0500, user-e9cc5d6c2490@xymon.invalid wrote:
I installed Hobbit on my (former) BB server.  The clients are
reporting in normally.  However, I have some tests for hosts (NetApp, Tandem - that have no BB client) that run on the BB server and use the bb executable to "trick" the server into thinking it received it from an external client.  For example:

exec("/opt/bb/bin/bb", $IP, "status $machine.$test $color $now\n  $status\n  @array\n  ")   or die( "$1: Couldn't execute BB");


Is there an equivalent function on the Hobbit server that can
accomplish this without having both BB and Hobbit installed?

list Paul van Eldijk · Fri, 08 Jul 2005 10:51:18 +0200 ·
quoted from Reif Jeffery M
On Thursday 7 July 2005 22:27, Reif Jeffery M wrote:
I installed Hobbit on my (former) BB server.  The clients are reporting
in normally.  However, I have some tests for hosts (NetApp, Tandem -
that have no BB client) that run on the BB server and use the bb
executable to "trick" the server into thinking it received it from an
external client.  For example:

exec("/opt/bb/bin/bb", $IP, "status $machine.$test $color $now\n
$status\n
@array\n
")
  or die( "$1: Couldn't execute BB");
If you're using Perl, you can do without bb, e.g.:

    use Sys::Hostname;

    my $line  = "status " . hostname . ".$BBTEST $color ";
       $line .=  scalar(localtime);
       $line .= "\n$status\n at array\n";

    use IO::Socket::INET;

    my $bb = IO::Socket::INET->new("$BBHOST:$BBPORT");

    if ( $bb and $bb->connected ) {
        $bb->send($line);
        $bb->shutdown(2);
    }
    else {
        warn "error connecting to Big Brother (host $BBHOST, port $BBPORT)\n";
    }

HTH,
Paul
list Eric van de Meerakker · Fri, 8 Jul 2005 11:06:03 +0200 ·
Please don't do that! The bb executable knows about multiple bb servers etc.
Plea use exec(".../bb", $BBDISP, "...") and save any future users of your
extension scripts a lot of headaches...


Eric

mail to : user-004bb4e22963@xymon.invalid
phone   : +XX (X)XX XXX XXXX
fax     : +XX (X)XX XXX XXXX
quoted from Paul van Eldijk


-----Original Message-----
From: Paul van Eldijk [mailto:user-86c97c6293b5@xymon.invalid] 
Sent: Friday, July 08, 2005 10:51 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] how to implement custom tests

On Thursday 7 July 2005 22:27, Reif Jeffery M wrote:
I installed Hobbit on my (former) BB server.  The clients are reporting
in normally.  However, I have some tests for hosts (NetApp, Tandem -
that have no BB client) that run on the BB server and use the bb
executable to "trick" the server into thinking it received it from an
external client.  For example:

exec("/opt/bb/bin/bb", $IP, "status $machine.$test $color $now\n
$status\n
@array\n
")
  or die( "$1: Couldn't execute BB");
If you're using Perl, you can do without bb, e.g.:

    use Sys::Hostname;

    my $line  = "status " . hostname . ".$BBTEST $color ";
       $line .=  scalar(localtime);
       $line .= "\n$status\n at array\n";

    use IO::Socket::INET;

    my $bb = IO::Socket::INET->new("$BBHOST:$BBPORT");

    if ( $bb and $bb->connected ) {
        $bb->send($line);
        $bb->shutdown(2);
    }
    else {
        warn "error connecting to Big Brother (host $BBHOST, port
$BBPORT)\n";
    }

HTH,
Paul