[Nagiosplug-devel] [ nagiosplug-Bugs-3472308 ] check_snmp: Regex not applied to numeric values

SourceForge.net noreply at sourceforge.net
Wed Jan 11 09:51:43 CET 2012


Bugs item #3472308, was opened at 2012-01-11 00:51
Message generated for change (Tracker Item Submitted) made by shrank
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3472308&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Argument proccessing
Group: release-1.4.15
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Michael Salathe (shrank)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_snmp: Regex not applied to numeric values

Initial Comment:
Thc check_snmp plugin doesn't test the regex if the return value is numeric. The check will always be OK as long as value is returned.

In Version 1.4.14 the numeric comaprisons where applied only if the tresholds have been set. This has been changed in 1.4.15. 

Version 1.4.14:
check_snmp -H 192.1686.1.1 -o ifOperStatus.2 -C public -r "up"
SNMP CRITICAL - *down(2)* |

Version 1.4.15:
check_snmp -H 192.1686.1.1 -o ifOperStatus.2 -C public -r "up"
SNMP OK - 2 | IF-MIB::ifOperStatus.2=2


IMHO the regex and string test should be applied to all values (even numeric). Therefore the "else if" on line 439 should be changed to a normal  if.

 408   if (is_numeric) {
 ...      /* do some numeric comaprisons */
444    }
445
446    /* Process this block for string matching */
447   else if (eval_method[i] & CRIT_STRING) {
..
444  }



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3472308&group_id=29880




More information about the Devel mailing list