Xymon Mailing List Archive search

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

list Charles Jones
Fri, 21 Mar 2008 10:44:50 -0700
Message-Id: <user-db94e55db3df@xymon.invalid>

Ralph Mitchell wrote:
On Thu, Mar 20, 2008 at 5:43 PM, Charles Jones <user-e86b4aeade4e@xymon.invalid <mailto:user-e86b4aeade4e@xymon.invalid>> 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