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 /t/Nagios-Plugin-04.t | |
parent | 95426817f66bbc7a1e4ad998fe10f327f0096257 (diff) | |
download | monitoring-plugin-perl-cce4fccf608b3e4accf7cbf2f11da23b3d627f15.tar.gz |
check_threshold to check multiple values at once
Diffstat (limited to 't/Nagios-Plugin-04.t')
-rw-r--r-- | t/Nagios-Plugin-04.t | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/t/Nagios-Plugin-04.t b/t/Nagios-Plugin-04.t index d88ad73..e5eb3ab 100644 --- a/t/Nagios-Plugin-04.t +++ b/t/Nagios-Plugin-04.t | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | use strict; | 4 | use strict; |
5 | #use Test::More 'no_plan'; | 5 | #use Test::More 'no_plan'; |
6 | use Test::More tests=>26; | 6 | use Test::More tests=>30; |
7 | 7 | ||
8 | BEGIN { use_ok('Nagios::Plugin') }; | 8 | BEGIN { use_ok('Nagios::Plugin') }; |
9 | use Nagios::Plugin::Functions; | 9 | use Nagios::Plugin::Functions; |
@@ -52,6 +52,12 @@ is $p->check_threshold(6), WARNING, "check_threshold WARNING"; | |||
52 | is $p->check_threshold(11), CRITICAL, "check_threshold CRITICAL"; | 52 | is $p->check_threshold(11), CRITICAL, "check_threshold CRITICAL"; |
53 | is $p->check_threshold(check=>11), CRITICAL, "check_threshold CRITICAL with hash param"; | 53 | is $p->check_threshold(check=>11), CRITICAL, "check_threshold CRITICAL with hash param"; |
54 | 54 | ||
55 | # Check that arrays allowed | ||
56 | is $p->check_threshold([2,1]), OK, "check_threshold OK when called implicitly"; | ||
57 | is $p->check_threshold([6,2]), WARNING, "check_threshold WARNING"; | ||
58 | is $p->check_threshold([1,2,6,11]), CRITICAL, "check_threshold CRITICAL"; | ||
59 | is $p->check_threshold(check=>[1,2,6,11]), CRITICAL, "check_threshold CRITICAL with hash param"; | ||
60 | |||
55 | # thresholds set explicitly | 61 | # thresholds set explicitly |
56 | is $p->check_threshold( | 62 | is $p->check_threshold( |
57 | check => 2, | 63 | check => 2, |