From 35811848da1095525e6937159f6611fc8a87261b Mon Sep 17 00:00:00 2001 From: Stephane Lapie Date: Fri, 15 Nov 2013 11:04:55 +0900 Subject: Handle negative values properly with check_snmp check_snmp becomes capable of evaluating negative values properly, but it might be returning CRITICALs where it used to return OK and was ignored, if a negative value turns out to actually be a valid value. If negative values are valid, this can be worked around, by adding "~:" to the warning/critical threshold : 100 -> ~:100 --- plugins/check_snmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/check_snmp.c') diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index ca17970c..d516fbc1 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c @@ -459,7 +459,7 @@ main (int argc, char **argv) /* Process this block for numeric comparisons */ /* Make some special values,like Timeticks numeric only if a threshold is defined */ if (thlds[i]->warning || thlds[i]->critical || calculate_rate) { - ptr = strpbrk (show, "0123456789"); + ptr = strpbrk (show, "-0123456789"); if (ptr == NULL) die (STATE_UNKNOWN,_("No valid data returned (%s)\n"), show); while (i >= response_size) { -- cgit v1.2.3