diff options
author | tonvoon <ton.voon@opsview.com> | 2010-06-30 07:56:05 (GMT) |
---|---|---|
committer | tonvoon <ton.voon@opsview.com> | 2010-06-30 07:56:05 (GMT) |
commit | 752dbc20b2bfbeb2b7d253b67fa6eda3adefb8c6 (patch) | |
tree | 26e40ed9f3828acc4b1e4df36c144ca754bbe706 /plugins/tests | |
parent | 0aa751937455c4af4e49ccf6ba469c0b4ca8a4d0 (diff) | |
download | monitoring-plugins-752dbc20b2bfbeb2b7d253b67fa6eda3adefb8c6.tar.gz |
Tests for --rate-multiplier option
Diffstat (limited to 'plugins/tests')
-rwxr-xr-x | plugins/tests/check_snmp.t | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/tests/check_snmp.t b/plugins/tests/check_snmp.t index a7a8d2c..0fa1691 100755 --- a/plugins/tests/check_snmp.t +++ b/plugins/tests/check_snmp.t | |||
@@ -141,6 +141,19 @@ is($res->return_code, 0, "OK as no thresholds" ); | |||
141 | is($res->output, "SNMP RATE OK - inoctets 333 | inoctets-rate=333 ", "Check rate decreases due to longer interval"); | 141 | is($res->output, "SNMP RATE OK - inoctets 333 | inoctets-rate=333 ", "Check rate decreases due to longer interval"); |
142 | 142 | ||
143 | 143 | ||
144 | |||
145 | $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -l inoctets_per_minute --rate-multiplier=60" ); | ||
146 | is($res->return_code, 0, "OK for first call" ); | ||
147 | is($res->output, "No previous data to calculate rate - assume okay" ); | ||
148 | |||
149 | # Need to sleep, otherwise duration=0 | ||
150 | sleep 1; | ||
151 | |||
152 | $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -l inoctets_per_minute --rate-multiplier=60" ); | ||
153 | is($res->return_code, 0, "OK as no thresholds" ); | ||
154 | is($res->output, "SNMP RATE OK - inoctets_per_minute 11.1 | inoctets_per_minute-rate=11.1 ", "Checking multiplier"); | ||
155 | |||
156 | |||
144 | $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.11 -s '\"stringtests\"'" ); | 157 | $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.11 -s '\"stringtests\"'" ); |
145 | is($res->return_code, 0, "OK as string matches" ); | 158 | is($res->return_code, 0, "OK as string matches" ); |
146 | is($res->output, 'SNMP OK - "stringtests" | ', "Good string match" ); | 159 | is($res->output, 'SNMP OK - "stringtests" | ', "Good string match" ); |