diff options
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; |
