diff options
author | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2009-07-31 03:50:42 -0400 |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2009-07-31 03:52:10 -0400 |
commit | 43571dba915621251378e35e85cc593803d9fbe6 (patch) | |
tree | 7e550b7b9b24809516946d4611e311f358c3877a /plugins/t | |
parent | 8a96ee4741633cf8e832903f7ce0f542a77dbed8 (diff) | |
download | monitoring-plugins-43571dba915621251378e35e85cc593803d9fbe6.tar.gz |
check_snmp: Add some verbose output and tests
Diffstat (limited to 'plugins/t')
-rw-r--r-- | plugins/t/check_snmp.t | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/t/check_snmp.t b/plugins/t/check_snmp.t index e0138e6b..2ce08585 100644 --- a/plugins/t/check_snmp.t +++ b/plugins/t/check_snmp.t @@ -8,7 +8,7 @@ use strict; use Test::More; use NPTest; -my $tests = 44; +my $tests = 46; plan tests => $tests; my $res; @@ -54,6 +54,10 @@ SKIP: { cmp_ok( $value, ">", 0, "Got a time value" ); like($res->perf_output, "/sysUpTime.*$1/", "Got perfdata with value '$1' in it"); + $res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o .1.3.6.1.2.1.1.3.0 -w 1: -c 1:"); + cmp_ok( $res->return_code, '==', 0, "Test with numeric OID (no mibs loaded)" ); + like($res->output, '/^SNMP OK - \d+/', "String contains SNMP OK"); + $res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o system.sysDescr.0"); cmp_ok( $res->return_code, '==', 0, "Exit OK when querying sysDescr" ); unlike($res->perf_output, '/sysDescr/', "Perfdata doesn't contain string values"); |