NAME
Nagios::Spool::Writer - drop check results into Nagios' check_result_path.
SYNOPSIS
my $nw = Nagios::Spool::Writer->new(
checkresults_dir => $checkresultsdir,
service_description => $service_description,
check_name => $check_name,
host_name => $hostname,
return_code => 0, # 1 2 3
output => 'looks (good|bad|horrible) | performancedata'
);
$nw->write_file;
DESCRIPTION
This module gives you the ability to drop checkresults directly into Nagios' check_result_path.
CONSTRUCTOR
new( %ARGS )
- checkresults_dir DIRECTORY
-
The directory where Nagios' configuration option `check_result_path' points to.
- hostname STRING
-
The hostname on which the check is bound to.
- service_description STRING
-
The service description of the check. This is optional, if you omit it, the result is treated as a check result for the host check of hostname
- check_name STRING
-
The name of the check. A nagios check typically returns a line as follows:
CHECKNAME STATUS - MESSAGE | PERFORMANCE_DATAThis method sets the value of CHECKNAME.
- output STRING
-
This sets the text after the dash of the nagios output. (see check_name). Currently you have to supply performance data to this method, for example:
$nw->output('/nagios fetched in 0.1s | time=0.1;1;5') - return_code NUMBER
-
This also sets the value of STATUS (see check_name). It defaults to `0' if omited.
METHODS
write_file
Write the check_result into Nagios' check_result_path.
LIMITATIONS
This module is in an early stage of development, the API is likely to brake in the future.
Also it interacts with an undocumented feature of Nagios. This feature may disappear in the future.
AUTHOR
Danijel Tasov, <data@cpan.org>
COPYRIGHT
Copyright (C) 2009, Danijel Tasov
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.