summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 752dbc2)
raw | patch | inline | side by side (parent: 752dbc2)
author | tonvoon <ton.voon@opsview.com> | |
Wed, 30 Jun 2010 09:37:10 +0000 (09:37 +0000) | ||
committer | tonvoon <ton.voon@opsview.com> | |
Wed, 30 Jun 2010 09:37:10 +0000 (09:37 +0000) |
plugins/check_snmp.c | patch | blob | history | |
plugins/tests/check_snmp.t | patch | blob | history |
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index f8cae9b6297606136fe2ccf00d182eb6339c3977..e6707a0851567ceb5df167546574ddd385aa065e 100644 (file)
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
temp_string=labels[i];
else
temp_string=oidname;
- if(calculate_rate)
- asprintf(&temp_string,"%s-rate",temp_string);
strncat(perfstr, temp_string, sizeof(perfstr)-strlen(perfstr)-1);
strncat(perfstr, "=", sizeof(perfstr)-strlen(perfstr)-1);
len = sizeof(perfstr)-strlen(perfstr)-1;
index 0fa1691e14b71adc5cb93432abea7b221eb65080..1e350f2324e36bbc73069fe8ad3183e225e45394 100755 (executable)
}
}
-my $tests = 29;
+my $tests = 33;
if (-x "./check_snmp") {
plan tests => $tests;
} else {
$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 -w 600" );
is($res->return_code, 1, "WARNING - due to going above rate calculation" );
-is($res->output, "SNMP RATE WARNING - *666* | iso.3.6.1.4.1.8072.3.2.67.10-rate=666 ");
+is($res->output, "SNMP RATE WARNING - *666* | iso.3.6.1.4.1.8072.3.2.67.10=666 ");
$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 -w 600" );
is($res->return_code, 3, "UNKNOWN - basically the divide by zero error" );
$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" );
is($res->return_code, 0, "OK as no thresholds" );
-is($res->output, "SNMP RATE OK - inoctets 666 | inoctets-rate=666 ", "Check label");
+is($res->output, "SNMP RATE OK - inoctets 666 | inoctets=666 ", "Check label");
sleep 2;
$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" );
is($res->return_code, 0, "OK as no thresholds" );
-is($res->output, "SNMP RATE OK - inoctets 333 | inoctets-rate=333 ", "Check rate decreases due to longer interval");
+is($res->output, "SNMP RATE OK - inoctets 333 | inoctets=333 ", "Check rate decreases due to longer interval");
$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" );
is($res->return_code, 0, "OK as no thresholds" );
-is($res->output, "SNMP RATE OK - inoctets_per_minute 11.1 | inoctets_per_minute-rate=11.1 ", "Checking multiplier");
+is($res->output, "SNMP RATE OK - inoctets_per_minute 11.1 | inoctets_per_minute=11.1 ", "Checking multiplier");
$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\"'" );