Skip to content

Commit

Permalink
check_snmp: small improvement by anonymous submission
Browse files Browse the repository at this point in the history
- response should not start with the delimiter
- OID response value taken into account

Closes issue monitoring-plugins#1029
Closes push request monitoring-plugins#1173
  • Loading branch information
waja committed Jul 20, 2014
1 parent 6c788de commit 0beaffe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/check_snmp.c
Expand Up @@ -380,6 +380,7 @@ main (int argc, char **argv)
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);
Expand Down Expand Up @@ -411,6 +412,9 @@ main (int argc, char **argv)
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";
Expand Down

0 comments on commit 0beaffe

Please sign in to comment.