You can use the bb program in the Big Brother /bin directory to send messages to the Big Brother server. For example, external scripts should use bb to send a status message to the server. There are two formats for the command:
bb IP Address "message"
or
bb IP Address -f filename
IP Address is the address of the Big Brother server to send the message to. To send a message to all BBDISPLAY servers, use $BBDISP as the address.
Message is the message to send; the format of the message varies depending on the message type. The entire message must be enclosed in quotes, as shown.
Filename is the path to a text file containing the message to send. If you use this format, be sure the contents of the file are in the correct format for the type of message you want to send.
Sending combo messages requires a different procedure.
Note. bb can also use standard input to process status data from a custom test. For example:
custom_check | $BB $BBDISP - &
The program (in this example, custom_check) needs to send a single line status to stdout (use the correct format for the type of message you want to send). This is very useful if the custom program is a daemon.
Note. To use bb to send a single message to a BBDISPLAY/BBPAGER in cron, remember that it requires the Big Brother environment to be loaded before it is executed. This loads environment variables which bb needs.
Use a crontab line similar to the following entry: (on a single line)
0 8-20 * * * BBHOME=/home/bb/bb;export BBHOME;. $BBHOME/etc/bbdef.sh; $BBHOME/bin/bb $BBDISP "status test.test red `date` This is a test"
The first part of this command (up through bbdef.sh) sets the Big Brother environment. The rest of the message sends the actual command. $BBDISP is the BBDISPLAY location.