[Xymon] Querying xymond with perl socket
Buchan Milne
bgmilne at staff.telkomsa.net
Tue Nov 15 15:33:46 CET 2011
On Tuesday, 15 November 2011 14:09:30 Olivier AUDRY wrote:
> 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);
Rather than everyone implement their own Hobbit/Xymon communication, wouldn't
it be better to ship standard modules (whether with the Xymon distribution, or
elsewhere).
I attach the module I worked on a while back, which one of my tests uses:
http://staff.telkomsa.net/~bgmilne/xymon/
Here is a simple script that demonstrates its use:
http://staff.telkomsa.net/~bgmilne/xymon/bb.pl
It would be nice if various people working on perl modules could agree to a
naming convention and feature set, and implement one set of interoperating
modules ...
Regards,
Buchan
More information about the Xymon
mailing list