diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2006-08-04 20:22:31 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2006-08-04 20:22:31 +0000 |
commit | 96933fd2e1f53aff9c9ef26639fafe9a84ec754e (patch) | |
tree | 307d23df452b83c4d6799303379e208c7adb6317 /lib/Nagios/Plugin/Threshold.pm | |
parent | c0f29b373c0339eec73e325fb15ebef6dd24d230 (diff) | |
download | monitoring-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/Threshold.pm')
-rw-r--r-- | lib/Nagios/Plugin/Threshold.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Nagios/Plugin/Threshold.pm b/lib/Nagios/Plugin/Threshold.pm index 1b332b9..494383f 100644 --- a/lib/Nagios/Plugin/Threshold.pm +++ b/lib/Nagios/Plugin/Threshold.pm | |||
@@ -7,6 +7,8 @@ use warnings; | |||
7 | 7 | ||
8 | use Nagios::Plugin::Range; | 8 | use Nagios::Plugin::Range; |
9 | use Nagios::Plugin::Base; | 9 | use Nagios::Plugin::Base; |
10 | use Nagios::Plugin; | ||
11 | our ($VERSION) = $Nagios::Plugin::VERSION; | ||
10 | 12 | ||
11 | use Class::Struct; | 13 | use Class::Struct; |
12 | struct "Nagios::Plugin::Threshold" => { | 14 | struct "Nagios::Plugin::Threshold" => { |
@@ -44,6 +46,7 @@ sub set_thresholds { | |||
44 | 46 | ||
45 | sub get_status { | 47 | sub get_status { |
46 | my ($self, $value) = @_; | 48 | my ($self, $value) = @_; |
49 | |||
47 | if ($self->critical->is_set) { | 50 | if ($self->critical->is_set) { |
48 | if ($self->critical->check_range($value) == 1) { | 51 | if ($self->critical->check_range($value) == 1) { |
49 | return $ERRORS{CRITICAL}; | 52 | return $ERRORS{CRITICAL}; |
@@ -54,6 +57,7 @@ sub get_status { | |||
54 | return $ERRORS{WARNING}; | 57 | return $ERRORS{WARNING}; |
55 | } | 58 | } |
56 | } | 59 | } |
60 | return $ERRORS{OK}; | ||
57 | } | 61 | } |
58 | 62 | ||
59 | 1; | 63 | 1; |