[Xymon] Querying xymond with perl socket

Olivier AUDRY olivier at audry.fr
Tue Nov 15 13:09:30 CET 2011


hello

I need to do a xymondboard directly with tcp. nc is working :

echo "hobbitdboard host=xxxxx test=ping" | nc xxx.xxx.xxx.xxx  1984

is working. But my perl code is not working :

#!/usr/bin/perl -w
use strict;
use IO::Socket;

$| = 1;

my $sock = new IO::Socket::INET (
                                PeerAddr => 'xxx.xxx.xxx.xxx',
                                PeerPort => '1984',
                                Proto    => 'tcp',
) or warn "Cannot connect to xymon : $!\n";

print $sock "hobbitdboard host=xxxx test=ping\n";

my $answer = <$sock>;
print "$answer\n";


close ($sock);

Someone can help me ?

thx

oau



More information about the Xymon mailing list