[hobbit] bbcmd usage

Henrik Stoerner henrik at hswn.dk
Tue Feb 13 17:27:39 CET 2007


On Tue, Feb 13, 2007 at 04:27:07PM +0100, Marganne, Etienne wrote:

> I recently discovered a nice tool within Hobbit, the bbcmd command. As far
> as I understood it can execute some command and pass environment variables
> to it. 

Correct, bbcmd reads the hobbitserver.cfg file (by default, you can use
another by giving bbcmd the --env=FILENAME option), establishes all of
the settings in hobbitserver.cfg as environment variables, and then runs
some command.

If you dont specify a command bbcmd will just launch a shell with the
environment definitions set.

> But I just do not catch everything if for i.e. I want to execute the
> bb-rep.cgi. What must I do?

bb-rep.cgi is a CGI-based utility, so to run it by hand you must mimick
the setup that a webserver provides for CGI programs. I.e. you must set
(at least) three environment variables:

   REQUEST_METHOD (usually set to "GET")
   SCRIPT_NAME (the name of the CGI program in the URL, e.g bb-rep.sh)
   QUERY_STRING (the part of the URL following the '?' sign)

The normal way of doing this would be

   REQUEST_METHOD="GET" \
   SCRIPT_NAME="bb-rep.sh" \
   QUERY_STRING="START-MON=Feb&START-DAY=9&START-YR=2007&END-MON=Feb&END-DAY=16&END-YR=2007&STYLE=crit" \
   bbcmd bb-rep.cgi


Regards,
Henrik




More information about the Xymon mailing list