diff options
author | Stephane Lapie <stephane.lapie@asahinet.com> | 2013-11-15 11:04:55 +0900 |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2014-01-31 00:49:18 -0500 |
commit | 35811848da1095525e6937159f6611fc8a87261b (patch) | |
tree | e7eaa71beb82c1bb9a181f35a2ec013c4f928179 /plugins/check_snmp.c | |
parent | c4e3cd6efd5aef8665db103a66996e619526ab3b (diff) | |
download | monitoring-plugins-35811848da1095525e6937159f6611fc8a87261b.tar.gz |
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
Diffstat (limited to 'plugins/check_snmp.c')
-rw-r--r-- | plugins/check_snmp.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
459 | /* Process this block for numeric comparisons */ | 459 | /* Process this block for numeric comparisons */ |
460 | /* Make some special values,like Timeticks numeric only if a threshold is defined */ | 460 | /* Make some special values,like Timeticks numeric only if a threshold is defined */ |
461 | if (thlds[i]->warning || thlds[i]->critical || calculate_rate) { | 461 | if (thlds[i]->warning || thlds[i]->critical || calculate_rate) { |
462 | ptr = strpbrk (show, "0123456789"); | 462 | ptr = strpbrk (show, "-0123456789"); |
463 | if (ptr == NULL) | 463 | if (ptr == NULL) |
464 | die (STATE_UNKNOWN,_("No valid data returned (%s)\n"), show); | 464 | die (STATE_UNKNOWN,_("No valid data returned (%s)\n"), show); |
465 | while (i >= response_size) { | 465 | while (i >= response_size) { |