diff options
| author | Ton Voon <tonvoon@gmail.com> | 2011-12-22 11:56:08 -0500 |
|---|---|---|
| committer | Ton Voon <tonvoon@gmail.com> | 2011-12-22 11:56:08 -0500 |
| commit | cce4fccf608b3e4accf7cbf2f11da23b3d627f15 (patch) | |
| tree | 95eab212877fef34e132c1ee4d33055611e3bb4d /lib/Nagios/Plugin.pm | |
| parent | 95426817f66bbc7a1e4ad998fe10f327f0096257 (diff) | |
| download | monitoring-plugin-perl-cce4fccf608b3e4accf7cbf2f11da23b3d627f15.tar.gz | |
check_threshold to check multiple values at once
Diffstat (limited to 'lib/Nagios/Plugin.pm')
| -rw-r--r-- | lib/Nagios/Plugin.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Nagios/Plugin.pm b/lib/Nagios/Plugin.pm index d2a5145..8950477 100644 --- a/lib/Nagios/Plugin.pm +++ b/lib/Nagios/Plugin.pm | |||
| @@ -110,7 +110,7 @@ sub check_threshold { | |||
| 110 | 110 | ||
| 111 | my %args; | 111 | my %args; |
| 112 | 112 | ||
| 113 | if ( $#_ == 0 && ! ref $_[0]) { # one positional param | 113 | if ( $#_ == 0 && (! ref $_[0] || ref $_[0] eq "ARRAY" )) { # one positional param |
| 114 | %args = (check => shift); | 114 | %args = (check => shift); |
| 115 | } | 115 | } |
| 116 | else { | 116 | else { |
| @@ -509,6 +509,9 @@ WARNING constant. The thresholds may be: | |||
| 509 | 3. implicitly set by command-line parameters -w, -c, --critical or | 509 | 3. implicitly set by command-line parameters -w, -c, --critical or |
| 510 | --warning, if you have run C<< $plugin->getopts() >>. | 510 | --warning, if you have run C<< $plugin->getopts() >>. |
| 511 | 511 | ||
| 512 | You can specify $value as an array of values and each will be checked against | ||
| 513 | the thresholds. | ||
| 514 | |||
| 512 | The return value is ready to pass to C <nagios_exit>, e . g ., | 515 | The return value is ready to pass to C <nagios_exit>, e . g ., |
| 513 | 516 | ||
| 514 | $p->nagios_exit( | 517 | $p->nagios_exit( |
