Page 1 of 1

check_snmp and junk perfdata

Posted: Tue Apr 17, 2012 4:58 pm
by dbeasley
I've fallen in love with and been disappointed by check_snmp on the same day. Someone please know the answer!

So I've found that if I query a SNMP value that is an INTEGER, everything looks good:

Code: Select all

root@nagios:~/workspace# /usr/local/nagios/libexec/check_snmp -H 10.1.11.184 -C nagios -o ifMtu.1 -v -l Data
/usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 [authpriv] 10.1.11.184:161 ifMtu.1
IF-MIB::ifMtu.1 = INTEGER: 16436
SNMP OK - Data 16436 | Data=16436
However if the data is Counter32, it appends a little 'c' to the end of the perfdata:

Code: Select all

root@nagios:~/workspace# /usr/local/nagios/libexec/check_snmp -H 10.1.11.184 -C nagios -o ipInDelivers.0 -v -l Data
/usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 [authpriv] 10.1.11.184:161 ipInDelivers.0
IP-MIB::ipInDelivers.0 = Counter32: 834555526
SNMP OK - Data 834555526 | Data=834555526c
What the heck? It's causing a lot of weird results in PNP4NAGIOS and just breaking the graphs. Where is that little 'c' coming from and how can I get rid of it? I've already tested multiple sources with Counter32 data... it happens for ALL of them.

Re: check_snmp and junk perfdata

Posted: Wed Apr 18, 2012 10:58 am
by dbeasley
Just switched to this buried gem instead:

check_snmp_oid
http://exchange.nagios.org/directory/Pl ... id/details

Had to tweak a couple things to make it work properly in my environment, but otherwise - no more junk perfdata. Highly recommended if you have the same "check_snmp" problems I did.