Nagios::Spool::Writer - drop check results into Nagios' check_result_path.
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;
This module gives you the ability to drop checkresults directly into Nagios' check_result_path.
The directory where Nagios' configuration option `check_result_path' points to.
The hostname on which the check is bound to.
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
The name of the check. A nagios check typically returns a line as follows:
CHECKNAME STATUS - MESSAGE | PERFORMANCE_DATA
This method sets the value of CHECKNAME.
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')
This also sets the value of STATUS (see check_name). It defaults to `0' if omited.
Write the check_result into Nagios' check_result_path.
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.
Danijel Tasov, <data@cpan.org>
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.
To install Nagios::Spool::Writer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Nagios::Spool::Writer
CPAN shell
perl -MCPAN -e shell install Nagios::Spool::Writer
For more information on module installation, please visit the detailed CPAN module installation guide.