BBPerl - Perl module for the ease of writing Perl based big brother monitors.
$bbmonitor = new BBPerl ('My_Monitor');
$bbmonitor->addMsg('Something is very wrong');
This module is designed to ease the ability to send Big Brother style monitor messages.
It will check to make sure it is running with a proper environment by making sure the environment variables BBHOME and BBTMP are set. If they are not, it will cause the program to abort with a message explaining the reason for the failure.
When called with a parameter, this sets the debug level. When no argument is used, returns the debug level.
When called with a parameter, this sets the name of the test, or otherwise known as the column name under which to report the results of the monitor test. When no arguement is used, it returns the name of the test.
While anything can be set here, the only valid stati for Big Brother are (green, yellow, red, purple). When called with a parameter, this sets the status of the report. When no arguement is used, it returns the current status.
Adds more information to the report sent back to the Big Brother server. Each time this is called, the message is appended with an automatic line feed. Currently, this reporting tool only allows up to 75 lines to be reported. Most BB servers only allow 50 lines, then show a DATA TRUNCATED message.
This will return the number of lines that are in the current message buffer. This can be useful to see if during a long report, you are coming close to the maximum number of lines that BB is allowed to accept.
This method will tell you what the BB Display server is set to, or if you call it with a parameter, it will override what the current BB environment has set for the Big Brother Pager.
This method will tell you what will be reported to the Big Brother server as the originating host name. If you set this, it will report to big brother as if it were coming from the host name specified. If you set this value, it will set the useFQDN to 0.
This method will instruct the BB monitor to report the full FQDN of the host. If set to 1, the domain name of the host will be included in the report. If set to 0, only the hostname will be reported to the BB server. Setting this value will override the hostname set using the $bbmonitor->hostname function and set it either to the hostname or the hostfqdn. Checking this value will let you know if the monitor will report the FQDN.
This method will tell you what the BBHOME environment variable is set to. You can change this by passing a parameter with a new path, but this is HIGHLY not recommended.
This method will tell you the full path to the big brother client executable. You can change this by passing a parameter with a new path. I saw no need for this, however in the spirit of flexibility, I put this in here.
This method will tell you the full path to Big Brother temp directory. You can change the temp directory by setting this parameter, however it is highly discouraged.
This method should be called last to send the message to the Big Brother server.
Eirik Toft (firstname.lastname@example.org) with thanks to Kenneth T Dreyer who created more platform independancy in the code.