X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fcheck_snmp.c;h=a4be11bc64c648b3e7baeeed326155eb000117f2;hb=07a08052081b59d26add4adf0ae4519fbacb8a36;hp=b0059845358cbd19755a208462e16828759aadf9;hpb=0c3386274ef5002dffc20337ef02407f24d7400c;p=nagiosplug.git diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index b005984..a4be11b 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c @@ -297,6 +297,8 @@ main (int argc, char **argv) show = strstr (response, "Gauge: ") + 7; else if (strstr (response, "Gauge32: ")) show = strstr (response, "Gauge32: ") + 9; + else if (strstr (response, "Counter32: ")) + show = strstr (response, "Counter32: ") + 11; else if (strstr (response, "INTEGER: ")) show = strstr (response, "INTEGER: ") + 9; else @@ -319,6 +321,8 @@ main (int argc, char **argv) eval_method[i] & WARN_EQ || eval_method[i] & WARN_NE) { p2 = strpbrk (p2, "0123456789"); + if (p2 == NULL) + terminate (STATE_UNKNOWN,"No valid data returned"); response_value[i] = strtoul (p2, NULL, 10); iresult = check_num (i); asprintf (&show, "%lu", response_value[i]);