#373 Fixes for check_snmp

open
nobody
None
5
2011-12-22
2011-12-22
Anonymous
No

A small patch:

- response should not start with the delimiter
- OID response value taken into account

--- nagios-plugins-1.4.15/plugins/check_snmp.c.rmap 2011-12-22 14:23:26.000000000 +0100
+++ nagios-plugins-1.4.15/plugins/check_snmp.c 2011-12-22 14:27:30.000000000 +0100
@@ -322,6 +322,7 @@
response = strstr (ptr, delimiter);
if (response == NULL)
break;
+ response = response + 3;

if (verbose > 2) {
printf("Processing oid %i (line %i)\n oidname: %s\n response: %s\n", i+1, line+1, oidname, response);
@@ -353,6 +354,9 @@
else if (strstr (response, "INTEGER: ")) {
show = strstr (response, "INTEGER: ") + 9;
}
+ else if (strstr (response, "OID: ")) {
+ show = strstr (response, "OID: ") + 5;
+ }
else if (strstr (response, "STRING: ")) {
show = strstr (response, "STRING: ") + 8;
conv = "%.10g";

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks