From e5109f99c9657a1a8e9fb32b19254a417e2ccd65 Mon Sep 17 00:00:00 2001 From: Gavin Carr Date: Wed, 14 Mar 2007 23:47:23 +0000 Subject: Refactor N::P::Performance; cleanups to Threshold and Range (mostly perldocs). git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1640 f882894a-f735-0410-b71e-b25c423dba1c --- lib/Nagios/Plugin/Threshold.pm | 43 ++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) (limited to 'lib/Nagios/Plugin/Threshold.pm') diff --git a/lib/Nagios/Plugin/Threshold.pm b/lib/Nagios/Plugin/Threshold.pm index b2afd8e..0c4805a 100644 --- a/lib/Nagios/Plugin/Threshold.pm +++ b/lib/Nagios/Plugin/Threshold.pm @@ -58,38 +58,49 @@ __END__ =head1 NAME -Nagios::Plugin::Threshold - Threshold information in a perl object +Nagios::Plugin::Threshold - class for handling Nagios::Plugin thresholds. -=head1 DESCRIPTION +=head1 SYNOPSIS -Handles common Nagios Plugin threshold data. See Nagios::Plugin or Nagios::Plugin::Performance for -creation of this object. + # NB: This is an internal Nagios::Plugin class. + # See Nagios::Plugin itself for public interfaces. + + # Constructor + $t = Nagios::Plugin::Threshold->set_thresholds( + warning => $warning_range_string, + critical => $critical_range_string, + ); -=head1 OBJECT METHODS + # Value checking - returns CRITICAL if in the critical range, + # WARNING if in the warning range, and OK otherwise + $status = $t->get_status($value); -=over 4 + # Accessors - return the associated N::P::Range object + $warning_range = $t->warning; + $critical_range = $t->critical; -=item warning, critical -Returns the warning or critical range as a Nagios::Plugin::Range object. +=head1 DESCRIPTION -=item get_status($value) +Internal Nagios::Plugin class for handling threshold data. See +Nagios::Plugin for public interfaces. -Given a value, will see if the value breaches the critical or the warning range. Returns the status code. +A threshold object contains (typically) a pair of ranges, associated +with a particular severity e.g. -=back + warning => range1 + critical => range2 =head1 AUTHOR -This code is maintained by the Nagios Plugin Development Team: http://nagiosplug.sourceforge.net +This code is maintained by the Nagios Plugin Development Team: see +http://nagiosplug.sourceforge.net. =head1 COPYRIGHT AND LICENSE -Copyright (C) 2006 Nagios Plugin Development Team +Copyright (C) 2006-2007 Nagios Plugin Development Team This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself, either Perl version 5.8.4 or, -at your option, any later version of Perl 5 you may have available. - +it under the same terms as Perl itself. =cut -- cgit v1.2.3-74-g34f1