check_snmp oddity

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
merrittr
Posts: 2
Joined: Wed Mar 04, 2015 8:52 am

check_snmp oddity

Post by merrittr »

when I run snmpwalk using v2 or v1 on IP172.168.101.139 OID:.1.3.6.1.2.1.1.3 i get the sysUpTime.0

when i do the same with check_snmp i get the message There is no such variable name in this MIB.
is there some formatting for check_snmp that I need?


P.S. this however does work:
# /usr/lib/nagios/plugins/check_snmp -H 172.168.101.139 -C public -o .1.3.6.1.2.1.25.5.1.1.1.1
SNMP OK - 1654 | iso.3.6.1.2.1.25.5.1.1.1.1=1654



# snmpwalk -v2c -c public 172.168.101.139 .1.3.6.1.2.1.1.3
iso.3.6.1.2.1.1.3.0 = Timeticks: (59448377) 6 days, 21:08:03.77
# /usr/lib/nagios/plugins/check_snmp -H 172.168.101.139 -C public -o .1.3.6.1.2.1.1.0.1
External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.3.6.1.2.1.1.0.1
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: check_snmp oddity

Post by jdalrymple »

check_snmp is not intended to work like snmpwalk or snmpgetnext, it can only return 1 OID.

Your command should look like:

Code: Select all

./check_snmp -H 172.168.101.139 -C public -o 1.3.6.1.2.1.1.3.0
Does that help?
User avatar
rhassing
Posts: 412
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: check_snmp oddity

Post by rhassing »

You are using two different oid's:

Code: Select all

snmpwalk -v2c -c public 172.168.101.139 .1.3.6.1.2.1.1.3

Code: Select all

/usr/lib/nagios/plugins/check_snmp -H 172.168.101.139 -C public -o .1.3.6.1.2.1.1.0.1
If you change your check to use .1.3.6.1.2.1.1.3.0 as well instead of .1.3.6.1.2.1.1.0.1. It should work.
Rob Hassing
Image
merrittr
Posts: 2
Joined: Wed Mar 04, 2015 8:52 am

Re: check_snmp oddity

Post by merrittr »

thanks guys


/usr/lib/nagios/plugins/check_snmp -H 172.168.101.139 -C public -o 1.3.6.1.2.1.1.3.0

did the trick
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_snmp oddity

Post by abrist »

Great, locking 'er up!
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