diff options
author | Gavin Carr <gonzai@users.sourceforge.net> | 2007-03-14 23:47:23 +0000 |
---|---|---|
committer | Gavin Carr <gonzai@users.sourceforge.net> | 2007-03-14 23:47:23 +0000 |
commit | e5109f99c9657a1a8e9fb32b19254a417e2ccd65 (patch) | |
tree | 2fdbad42f466051ffc2e332cf0a2573976e3a56c /lib/Nagios/Plugin/Threshold.pm | |
parent | 489df48f9d1891b46ae4be911080ab4667058f2d (diff) | |
download | monitoring-plugin-perl-e5109f99c9657a1a8e9fb32b19254a417e2ccd65.tar.gz |
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
Diffstat (limited to 'lib/Nagios/Plugin/Threshold.pm')
-rw-r--r-- | lib/Nagios/Plugin/Threshold.pm | 43 |
1 files changed, 27 insertions, 16 deletions
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__ | |||
58 | 58 | ||
59 | =head1 NAME | 59 | =head1 NAME |
60 | 60 | ||
61 | Nagios::Plugin::Threshold - Threshold information in a perl object | 61 | Nagios::Plugin::Threshold - class for handling Nagios::Plugin thresholds. |
62 | 62 | ||
63 | =head1 DESCRIPTION | 63 | =head1 SYNOPSIS |
64 | 64 | ||
65 | Handles common Nagios Plugin threshold data. See Nagios::Plugin or Nagios::Plugin::Performance for | 65 | # NB: This is an internal Nagios::Plugin class. |
66 | creation of this object. | 66 | # See Nagios::Plugin itself for public interfaces. |
67 | |||
68 | # Constructor | ||
69 | $t = Nagios::Plugin::Threshold->set_thresholds( | ||
70 | warning => $warning_range_string, | ||
71 | critical => $critical_range_string, | ||
72 | ); | ||
67 | 73 | ||
68 | =head1 OBJECT METHODS | 74 | # Value checking - returns CRITICAL if in the critical range, |
75 | # WARNING if in the warning range, and OK otherwise | ||
76 | $status = $t->get_status($value); | ||
69 | 77 | ||
70 | =over 4 | 78 | # Accessors - return the associated N::P::Range object |
79 | $warning_range = $t->warning; | ||
80 | $critical_range = $t->critical; | ||
71 | 81 | ||
72 | =item warning, critical | ||
73 | 82 | ||
74 | Returns the warning or critical range as a Nagios::Plugin::Range object. | 83 | =head1 DESCRIPTION |
75 | 84 | ||
76 | =item get_status($value) | 85 | Internal Nagios::Plugin class for handling threshold data. See |
86 | Nagios::Plugin for public interfaces. | ||
77 | 87 | ||
78 | Given a value, will see if the value breaches the critical or the warning range. Returns the status code. | 88 | A threshold object contains (typically) a pair of ranges, associated |
89 | with a particular severity e.g. | ||
79 | 90 | ||
80 | =back | 91 | warning => range1 |
92 | critical => range2 | ||
81 | 93 | ||
82 | =head1 AUTHOR | 94 | =head1 AUTHOR |
83 | 95 | ||
84 | This code is maintained by the Nagios Plugin Development Team: http://nagiosplug.sourceforge.net | 96 | This code is maintained by the Nagios Plugin Development Team: see |
97 | http://nagiosplug.sourceforge.net. | ||
85 | 98 | ||
86 | =head1 COPYRIGHT AND LICENSE | 99 | =head1 COPYRIGHT AND LICENSE |
87 | 100 | ||
88 | Copyright (C) 2006 Nagios Plugin Development Team | 101 | Copyright (C) 2006-2007 Nagios Plugin Development Team |
89 | 102 | ||
90 | This library is free software; you can redistribute it and/or modify | 103 | This library is free software; you can redistribute it and/or modify |
91 | it under the same terms as Perl itself, either Perl version 5.8.4 or, | 104 | it under the same terms as Perl itself. |
92 | at your option, any later version of Perl 5 you may have available. | ||
93 | |||
94 | 105 | ||
95 | =cut | 106 | =cut |