[ nagiosplug-Bugs-3472308 ] check_snmp: Regex not applied to numeric values
SourceForge.net <[email protected]>
| Newsgroups | gmane.network.nagios.plugins.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #3472308, was opened at 2012-01-11 00:51
Message generated for change (Settings changed) made by hweiss
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: Holger Weiss (hweiss)
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
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________________
Nagios Plugin Development Mailing List Nagiosplug-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Unsubscribe at https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
::: Please include plugins version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null