[ 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 (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

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.