The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Xymon::Plugin::Server::Status - Xymon status reporter

SYNOPSIS

    use Xymon::Plugin::Server::Status qw(:colors);
    my $status = Xymon::Plugin::Server::Status->new("myhostname", "test");

    $status->add_status(GREEN, "this entry is OK");
    $status->add_status(RED, "this entry is NOT OK");
    $status->add_message("Hello! world");

    $status->add_devmon($devmon); # see Xymon::Plugin::Server::Devmon

    $status->add_graph("disk");

    $status->report;  # send status to Xymon server

EXPORT

Color names

  GREEN YELLOW RED CLEAR PURPLE BLUE

are exported with tag ':colors'

SUBROUTINES/METHODS

new(hostname, testname, attr)

Create status object for hostname and testname.

attr is optional hashref to change actions of object. Currently, following parameter is defined.

EscapeMessage
0 - nochange (default)

Make no change to message.

1 - replace to '_'

Some characters (<, >, &) are replaced to '_'.

2 - html escape

'<', '>, '&' are replaced to '&lt;', '&gt;', '&amp' respectively.

add_status(color, msg)

Add status and its short message.

add_message(msg)

Add message shown in Xymon status page.

add_devmon(devmon)

Add devmon data. See Xymon::Plugin::Server::Devmon

add_graph(testname)

Add graph shown in Xymon status page. "test" name must be defined in graph definition file. (named hobbitgraph.cfg in Xymon 4.2, graphs.cfg in Xymon 4.3)

report

Report current status to Xymon server.