summaryrefslogtreecommitdiffstats
path: root/lib/Nagios/Plugin.pm
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2006-08-04 20:22:31 +0000
committerTon Voon <tonvoon@users.sourceforge.net>2006-08-04 20:22:31 +0000
commit96933fd2e1f53aff9c9ef26639fafe9a84ec754e (patch)
tree307d23df452b83c4d6799303379e208c7adb6317 /lib/Nagios/Plugin.pm
parentc0f29b373c0339eec73e325fb15ebef6dd24d230 (diff)
downloadmonitoring-plugin-perl-96933fd2e1f53aff9c9ef26639fafe9a84ec754e.tar.gz
Lots of extra tests and subsequent fixes (Nathan Vonnahme)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1466 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'lib/Nagios/Plugin.pm')
-rw-r--r--lib/Nagios/Plugin.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Nagios/Plugin.pm b/lib/Nagios/Plugin.pm
index 2acc6ea..4e95e98 100644
--- a/lib/Nagios/Plugin.pm
+++ b/lib/Nagios/Plugin.pm
@@ -23,7 +23,7 @@ use Exporter;
23our @ISA = qw(Exporter Nagios::__::Plugin); 23our @ISA = qw(Exporter Nagios::__::Plugin);
24our @EXPORT_OK = qw(%ERRORS); 24our @EXPORT_OK = qw(%ERRORS);
25 25
26our $VERSION = '0.12'; 26our $VERSION = '0.13';
27 27
28sub add_perfdata { 28sub add_perfdata {
29 my ($self, %args) = @_; 29 my ($self, %args) = @_;
@@ -59,7 +59,8 @@ Nagios::Plugin - Object oriented helper routines for your Nagios plugin
59 use Nagios::Plugin qw(%ERRORS); 59 use Nagios::Plugin qw(%ERRORS);
60 $p = Nagios::Plugin->new( shortname => "PAGESIZE" ); 60 $p = Nagios::Plugin->new( shortname => "PAGESIZE" );
61 61
62 $threshold = $p->set_thresholds( warning => "10:25", critical => "25:" ); 62 $threshold = $p->set_thresholds( warning => "10:25", critical => "~:25" );
63 # Critical if outside -INF to 25, ie > 25. Warn if outside 10-25, ie < 10
63 64
64 # ... collect current metric into $value 65 # ... collect current metric into $value
65 if ($trouble_getting_metric) { 66 if ($trouble_getting_metric) {
@@ -120,7 +121,7 @@ Initializes a new Nagios::Plugin object. Can specify the shortname here.
120 121
121=head1 OBJECT METHODS 122=head1 OBJECT METHODS
122 123
123=item set_thresholds( warning => "10:25", critical => "25:" ) 124=item set_thresholds( warning => "10:25", critical => "~:25" )
124 125
125Sets the thresholds, based on the range specification at 126Sets the thresholds, based on the range specification at
126http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT. 127http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT.
@@ -148,6 +149,8 @@ http://nagiosplug.sourceforge.net
148 149
149Ton Voon, E<lt>ton.voon@altinity.comE<gt> 150Ton Voon, E<lt>ton.voon@altinity.comE<gt>
150 151
152Thanks to Nathan Vonnahme for loads of extra tests and subsequent fixes.
153
151=head1 COPYRIGHT AND LICENSE 154=head1 COPYRIGHT AND LICENSE
152 155
153Copyright (C) 2006 by Nagios Plugin Development Team 156Copyright (C) 2006 by Nagios Plugin Development Team