[hobbit] bb cmd protocol? (was [hobbit] Windows version of a fully functional bb command)

Charles Jones jonescr at cisco.com
Fri Mar 21 18:44:50 CET 2008


Ralph Mitchell wrote:
> On Thu, Mar 20, 2008 at 5:43 PM, Charles Jones <jonescr at cisco.com 
> <mailto:jonescr at cisco.com>> wrote:
>
>     Henrik,
>
>     I'm talking about the connection protocol, not the message
>     protocol. So that I can write code that can connect to a BBDISPLAY
>     and send/receive data, without shelling out and using a bb
>     binary.  I've tried telnetting to port 1984 and typing various
>     commands, and also using netcat, none of which seem to work, so I
>     suspect that hobbitd is expecting to see some certain characters
>     before it will accept a command.
>
>     -Charles
>
>
>
> Would bb.pl be of any use to you??  As found on deadcat.net 
> <http://deadcat.net>:
>
> sub bb_send {
>   my ($bbdisp, $machinelist, $message) = @_;
>   my (%machine, @machinelist) = ();
>   @machinelist = ($bbdisp ne "0.0.0.0 <http://0.0.0.0>") ? ($bbdisp) : 
> @$machinelist;
>   for my $server (@machinelist) {
>     my ($port, $iaddr, $paddr, $proto);    # Variable réseau
>     # don't send the message twice to the same machine
>     next if $machine{$server};
>     $machine{$server} = 1;
>     debug("Host: $server\n");
>     $iaddr   = inet_aton($server)              || warn "bb: Unknown 
> host: $server\n", next;
>     $paddr   = sockaddr_in($PORT, $iaddr);
>     $proto   = getprotobyname('tcp');
>     socket(SOCK, PF_INET, SOCK_STREAM, $proto) || warn "bb: Can't open 
> stream socket\n", next;
>     connect(SOCK, $paddr)                      || warn "bb: CAN'T 
> CONNECT TO bbd SERVER @ $server", next;
>     # select((select(SOCK), $| = 1)[0]);         # unbuffer the socket
>     print SOCK $message;
>     close (SOCK);
>   }
> }

Indeed! From looking at that code, it is just a simple TCP 
connection...Hmm I guess I need to go see why my test code didn't work 
:-)  Thanks!

-Charles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20080321/272caaf5/attachment.html>


More information about the Xymon mailing list