[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] how to implement custom tests
- To: hobbit (at) hswn.dk
- Subject: Re: [hobbit] how to implement custom tests
- From: Paul van Eldijk <P.vanEldijk (at) uci.ru.nl>
- Date: Fri, 08 Jul 2005 10:51:18 +0200
- Organization: Universitair Centrum Informatievoorziening
- References: <C439F24B2933ED44A7E19C0A5819606F040D36@edxmb4.jdnet.deere.com>
- User-agent: KMail/1.8.1
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