summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@aei.ca>2009-07-31 05:20:59 (GMT)
committerThomas Guyot-Sionnest <dermoth@aei.ca>2009-07-31 05:41:03 (GMT)
commite0be2e6094a54771a7a310eea5853d2e05edf480 (patch)
tree3b6e461ba263556e6dcc9a6c24da363a20137137
parent4aec8e28c3f68570ad5d0bf96e0bd36aaac75065 (diff)
downloadmonitoring-plugins-e0be2e6094a54771a7a310eea5853d2e05edf480.tar.gz
Fix check_snmp Timetick test with <1 day uptime
-rw-r--r--plugins/t/check_snmp.t4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/t/check_snmp.t b/plugins/t/check_snmp.t
index cda12f4..e0138e6 100644
--- a/plugins/t/check_snmp.t
+++ b/plugins/t/check_snmp.t
@@ -95,11 +95,11 @@ SKIP: {
95 my $lower = $1 - 0.05; 95 my $lower = $1 - 0.05;
96 my $higher = $1 + 0.05; 96 my $higher = $1 + 0.05;
97 $res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o enterprises.ucdavis.laTable.laEntry.laLoad.3 -w $lower -c $higher"); 97 $res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o enterprises.ucdavis.laTable.laEntry.laLoad.3 -w $lower -c $higher");
98 cmp_ok( $res->return_code, '==', 1, "Exit WARNING with fractionnal arcuments"); 98 cmp_ok( $res->return_code, '==', 1, "Exit WARNING with fractionnal arguments");
99 99
100 $res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o system.sysUpTime.0,host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w ,:0 -c ,:2"); 100 $res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o system.sysUpTime.0,host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w ,:0 -c ,:2");
101 cmp_ok( $res->return_code, '==', 1, "Exit WARNING on 2nd threshold"); 101 cmp_ok( $res->return_code, '==', 1, "Exit WARNING on 2nd threshold");
102 like($res->output, '/^SNMP WARNING - Timeticks:\s\(\d+\)\s.*,\s.*\s\*1\*\s.*$/', "First OID returned as string, 2nd checked for thresholds"); 102 like($res->output, '/^SNMP WARNING - Timeticks:\s\(\d+\)\s+(?:\d+ days?,\s+)?\d+:\d+:\d+\.\d+\s+\*1\*\s.*$/', "First OID returned as string, 2nd checked for thresholds");
103 103
104 $res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w '' -c ''"); 104 $res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w '' -c ''");
105 cmp_ok( $res->return_code, '==', 0, "Empty thresholds doesn't crash"); 105 cmp_ok( $res->return_code, '==', 0, "Empty thresholds doesn't crash");