Constructor:newHobbit('testname');Constructor:newHobbit({test=>'testname',ttl=>60,...});
Creates a new Hobbit object.
Commonusecases
my $bb = new Hobbit('sometest');
my $bb = new Hobbit({ test => 'testname',
color => 'green',
hostname => 'host.example.com',
text => 'Test successful',
title => 'Some Test',
ttl => 60,
type => 'status',
dont_moan => 1 });
Availableparameters
color
The initial color of the test. (Default: "clear")
dont_moan
Disable moan() and croak() (see below). Needed if e.g. another used Perl module throws a lot of
warnings but works fine otherwise, etc.
hostname
The hostname for which the test should report. (Default: $ENV{CLIENTHOSTNAME} || $ENV{MACHINEDOTS} ||
$ENV{MACHINE} || 'unknown')
test
The name of the test, i.e. the name of the column on the hobbit status web pages. (Mandatory)
text
Text which is prepended to generated report. (Default: the empty string)
title
The summary of the test. (Default: "$test OK" respectively "$test NOT ok")
ttl
How long the test result is valid before the test state is changed to purple by the xymon daemon if no
newer test results have been received.
The default value is set on the xymon server and is 300 seconds by default.
Values without unit are interpreted as minutes. Valid units are h for hours, d for days, and w for
weeks. No space between value and unit allowed.
type
Allows one to send messages of other types than "status", e.g. data, notify, disable, enable, etc.
May not yet work with all of these types properly. Please report bugs via the Debian Bug Tracking
system.
Constructor:Hobbit::trends;Constructor:Hobbit::trends('hostname');
Creates a new Hobbit trends object. This is a shorthand for new Hobbit({ type = 'data', test = 'trends',
hostname = $hostname, dont_moan => 1 });
Commonusecase
my $trends = Hobbit::trends;
$trends->print ("[$bb->{test},extralabel.rrd]\n");
$trends->print ("DS:lambda:GAUGE:600:U:U $value\n");
$trends->send;
add_color('somecolor')
Minutes that a sub test caused the given color state. Adjusts the overall resulting color accordingly.
print('sometext')
Adds the given text to the end of the current report without changing the current color.
sprintf('format',args...)
Like the print() method, but using sprintf() with format string and arguments.
color_print('somecolor','sometext')
Adds the given text to the end of the current report and minutes that a sub test caused the given color
state. Adjusts the overall resulting color accordingly.
color_line('somecolor','sometext')
Adds the given text to the end of the current report and minutes that a sub test caused the given color
state. Prepends that text with an accordingly colored Xymon icon and adjusts the overall resulting color
accordingly.
graph('graphname')
Adds HTML for showing a graph. Xymon itself can only show a single graph per test (others can be added to
the "trends" column). This method works around that limitation by manually linking to the graph CGI.
send()
Sends the report to the xymon server.