check_snmp truncates load return strings

Kyle Tucker kylet at panix.com
Fri Mar 31 16:14:40 CEST 2006


Trying to debug this with gdb didn't help as it acts properly using
gdb. Why would this happen?

Program exited normally.
(gdb) run check_snmp -u "load average" -t 3 -P 3 -H 192.168.2.1 -L authPriv -U xxxxxx -a MD5 -A yyyyyy -X zzzzzz -o laLoad.2 
Starting program: /usr/local/nagios/libexec/check_snmp check_snmp -u "load average"  -t 3 -P 3 -H 192.168.2.1 -L authPriv -U xxxxxx -a MD5 -A yyyyyy -X zzzzzz -o laLoad.2
SNMP OK - 0.04 load average | UCD-SNMP-MIB::laLoad.2=0.04;;;;  
          ^^^^
Program exited normally.

vwatch# /usr/local/nagios/libexec/check_snmp -u "load average" -t 3 -P 3 -H 192.168.2.1 -L authPriv -U xxxxxx -a MD5 -A yyyyyy -X zzzzzz -o laLoad.2
SNMP OK - 0 load average | UCD-SNMP-MIB::laLoad.2=0;;;;  
         ^^^


> Hi,
>         If I use check_snmp to get the load from Net-SNMP's load
> directives, all comes back fine until I set -w or -c option. When
> I use these options, everything after the decimal point gets cut
> off. If I leave off the options, I get the full numeric value.
> Thoughts?
>                                                                                       
> # check_snmp -t 3 -P 3 -H 192.168.2.1 -L authPriv -U xxxxxx -a MD5 -A yyyyyy -X zzzzzz -o laLoad.1,laLoad.2,laLoad.3
> SNMP OK - 0.32 0.38 0.39 | UCD-SNMP-MIB::laLoad.1=0.32;;;; UCD-SNMP-MIB::laLoad.2=0.38;;;; UCD-SNMP-MIB::laLoad.3=0.39;;;;
> # check_snmp -t 3 -P 3 -H 192.168.2.1 -L authPriv -U xxxxxx -a MD5 -A yyyyyy -X zzzzzz -o laLoad.1,laLoad.2,laLoad.3 -w 1,1,1 -c 2,2,2
> SNMP OK - 0 0 0 | UCD-SNMP-MIB::laLoad.1=0;;;; UCD-SNMP-MIB::laLoad.2=0;;;; UCD-SNMP-MIB::laLoad.3=0;;;;
> # check_snmp -vvv -t 3 -P 3 -H 192.168.2.1 -L authPriv -U xxxxxx -a MD5 -A yyyyyy -X zzzzzz -o laLoad.1,>
> /usr/local/bin/snmpget -t 3 -r 5 -m ALL -v 3 -l authPriv -a MD5 -u xxxxxx -A yyyyyy -x DES -X zzzzzz  192.168.2.1:161  laLoad.1 laLoad.2 laLoad.3
> UCD-SNMP-MIB::laLoad.1 = STRING: 0.37
> UCD-SNMP-MIB::laLoad.2 = STRING: 0.39
> UCD-SNMP-MIB::laLoad.3 = STRING: 0.39
> SNMP OK - 0 0 0 | UCD-SNMP-MIB::laLoad.1=0;;;; UCD-SNMP-MIB::laLoad.2=0;;;; UCD-SNMP-MIB::laLoad.3=0;;;;
> 
> -- 
> - Kyle 
> ---------------------------------------------
> kylet at panix.com   http://www.panix.com/~kylet    
> ---------------------------------------------
> 


-- 
- Kyle 
---------------------------------------------
kylet at panix.com   http://www.panix.com/~kylet    
---------------------------------------------


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list