[Nagiosplug-devel] [ nagiosplug-Bugs-3003419 ] check_snmp converts negative values to positive

SourceForge.net noreply at sourceforge.net
Sat Mar 19 14:49:32 CET 2011


Bugs item #3003419, was opened at 2010-05-18 17:59
Message generated for change (Comment added) made by nobody42
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3003419&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: Parsing problem
Group: v1.4.14
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Matt Rose (oesor)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_snmp converts negative values to positive

Initial Comment:
When thresholds are defined, check_snmp converts negative integer snmp get values to positive:

root at ops-00:/usr/local/nagios/libexec# ./check_snmp -V
check_snmp v1.4.14 (nagios-plugins 1.4.14)

root at ops-00:/usr/local/nagios/libexec# ./check_snmp -H 192.168.1.100 -o DEVICE-MIB::CurrentNoiseFloor.0 -w=~:-85 -c=~:-80 -vvvv
/usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 [authpriv] 192.168.1.100:161 DEVICE-MIB::CurrentNoiseFloor.0
DEVICE-MIB::CurrentNoiseFloor.0 = INTEGER: -97
Processing line 1
  oidname: DEVICE-MIB::CurrentNoiseFloor.0
  response:  = INTEGER: -97
SNMP CRITICAL - *97* | DEVICE-MIB::CurrentNoiseFloor.0=97  

root at ops-00:/usr/local/nagios/libexec# ./check_snmp -H 192.168.1.100 -o DEVICE-MIB::CurrentNoiseFloor.0 -vvvv
/usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 [authpriv] 192.168.1.100:161 DEVICE-MIB::CurrentNoiseFloor.0
DEVICE-MIB::CurrentNoiseFloor.0 = INTEGER: -97
Processing line 1
  oidname: DEVICE-MIB::CurrentNoiseFloor.0
  response:  = INTEGER: -97
SNMP OK - -97 | DEVICE-MIB::CurrentNoiseFloor.0=-97  

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

Comment By: Nobody (nobody42)
Date: 2011-03-19 14:49

Message:
The bug is located in line 404 of actual code

404                         ptr = strpbrk (show, "0123456789"); 
should be changed to
404                         ptr = strpbrk (show, "-0123456789"); 


403                 if (thlds[i]->warning || thlds[i]->critical ||
calculate_rate) { 
404                         ptr = strpbrk (show, "0123456789"); 
405                         if (ptr == NULL)

Can someone fix please ?


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

Comment By: Matt Rose (oesor)
Date: 2010-05-18 18:20

Message:
s/thresholds are defined/thresholds are triggered/

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

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




More information about the Devel mailing list