check_snmp with multiple OIDs failing

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
andyford
Posts: 7
Joined: Mon Nov 03, 2014 6:53 am

check_snmp with multiple OIDs failing

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_snmp with multiple OIDs failing

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
andyford
Posts: 7
Joined: Mon Nov 03, 2014 6:53 am

Re: check_snmp with multiple OIDs failing

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_snmp with multiple OIDs failing

Post by abrist »

Fair enough, though verbose mode (-vvv) may shed some light on the "why?".
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
Bryan Quesada
Posts: 6
Joined: Wed Nov 05, 2014 10:23 am
Location: Costa Rica
Contact:

Re: check_snmp with multiple OIDs failing

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_snmp with multiple OIDs failing

Post by abrist »

Yeah, though I think OP's problem is related to an snmp device with an odd snmp implementation.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
Bryan Quesada
Posts: 6
Joined: Wed Nov 05, 2014 10:23 am
Location: Costa Rica
Contact:

Re: check_snmp with multiple OIDs failing

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_snmp with multiple OIDs failing

Post by abrist »

OP: Do you need any more help, or should we lock this thread?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked