Page 1 of 1

check_snmp with multiple OIDs failing

Posted: Mon Nov 03, 2014 1:22 pm
by andyford
I'm having trouble calling check_snmp with multiple OIDs. Tested with 1.14.16 and 2.0.3.
It works with some OIDs, but not others.

combo of syName & sysDescr works fine.

check_snmp -P 2c -H XXXX -C XXXX -o .1.3.6.1.2.1.1.5.0 -o .1.3.6.1.2.1.1.1.0 -l sysName -l sysDescr
SNMP OK - sysName "xBalancer1" sysDescr "xBalancer" |

Then there's these two OIDs, IF-MIB::ifOutOctets, and IF-MIB::ifInOctets, which work on their own.

check_snmp -P 2c -H XXXX -C XXXX -o .1.3.6.1.2.1.2.2.1.16.1
SNMP OK - 3234859200 | iso.3.6.1.2.1.2.2.1.16.1=3234859200c
check_snmp -P 2c -H XXXX -C XXXX -o .1.3.6.1.2.1.2.2.1.10.1
SNMP OK - 15737717 | iso.3.6.1.2.1.2.2.1.10.1=15737717c

But when I try to get those same two OIDs in one call, it fails.

check_snmp -P 2c -H XXXX -C XXXX -o .1.3.6.1.2.1.2.2.1.16.1 -o .1.3.6.1.2.1.2.2.1.10.1
External command error: Error in packet
Reason: (genError) A general failure occured
Failed object: iso.3.6.1.2.1.2.2.1.10.1

Re: check_snmp with multiple OIDs failing

Posted: Mon Nov 03, 2014 1:47 pm
by abrist
Odd. Using 2.0.3, I can check multiple oids:

Code: Select all

[root@nagiosxi libexec]# ./check_snmp -H <ip> -C <community> -v 1 -o .1.3.6.1.2.1.2.2.1.16.1 -o .1.3.6.1.2.1.2.2.1.10.1
SNMP OK - 0 0 | iso.3.6.1.2.1.2.2.1.16.1=0c iso.3.6.1.2.1.2.2.1.10.1=0c
Can you try running the check in verbose mode and post the output?

Code: Select all

check_snmp -P 2c -H XXXX -C XXXX -o .1.3.6.1.2.1.2.2.1.16.1 -o .1.3.6.1.2.1.2.2.1.10.1 -vvv

Re: check_snmp with multiple OIDs failing

Posted: Mon Nov 03, 2014 3:41 pm
by andyford
Must be something broken in the SNMP implementation of the device type I'm trying to poll then.
Thanks for the sanity check.

Re: check_snmp with multiple OIDs failing

Posted: Mon Nov 03, 2014 3:57 pm
by abrist
Fair enough, though verbose mode (-vvv) may shed some light on the "why?".

Re: check_snmp with multiple OIDs failing

Posted: Wed Nov 05, 2014 12:21 pm
by Bryan Quesada
check_snmp with multiple OIDs. Is simple only is executed as follows



./check_snmp -H 1x.x.x.x -C name -o .1.3.6.1.4.1.13045.1.1.2.2.1.4.3,.1.3.6.1.4.1.13045.1.1.2.2.1.4.1 -w 24,40 -c 40,42 -l "Temperature,Humidity"

OUTPUT:
Temperature CRITICAL - Temperature 22 Humidity *43* | Temperature=22;0:24;0:40 Humidity=43;0:40;0:42

Re: check_snmp with multiple OIDs failing

Posted: Wed Nov 05, 2014 12:27 pm
by abrist
Yeah, though I think OP's problem is related to an snmp device with an odd snmp implementation.

Re: check_snmp with multiple OIDs failing

Posted: Wed Nov 05, 2014 12:40 pm
by Bryan Quesada
You can test if the device returns data using snmpwalk.

Temperature
# snmpwalk -c name x.x.x.x -On .1.3.6.1.4.1.13045.1.1.2.2.1.4.3 -v1
.1.3.6.1.4.1.13045.1.1.2.2.1.4.3 = INTEGER: 22

Humidity
# snmpwalk -c name x.x.x.x -On .1.3.6.1.4.1.13045.1.1.2.2.1.4.1 -v1
.1.3.6.1.4.1.13045.1.1.2.2.1.4.1 = INTEGER: 45

The above command return data(INTEGER: 22, INTEGER: 45), we can say that the device returns information using snmp agent

Re: check_snmp with multiple OIDs failing

Posted: Wed Nov 05, 2014 4:28 pm
by abrist
OP: Do you need any more help, or should we lock this thread?