Page 1 of 1

Testing snmp_check plugin - No variable in MIB

Posted: Wed Jul 11, 2018 3:10 pm
by hbackus
snmp_check plugin returns an error when snmpwalk does not; I am confused if it is an issue with the plugin or the syntax I am using.

SNMPWALK returns a value for the OID I am checking:

snmpwalk -v 2c -c public 10.34.100.11 1.3.6.1.4.1.1991.1.1.1.1.18
SNMPv2-SMI::enterprises.1991.1.1.1.1.18.0 = INTEGER: 96

SNMP_CHECK returns multiple errors:

/usr/local/nagios/libexec/check_snmp -C public -H 10.34.100.11 -o 1.3.6.1.4.1.1991.1.1.1.1.18
External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.3.6.1.4.1.1991.1.1.1.1.18

plugin version is 2.2.1
/usr/local/nagios/libexec/check_snmp -V
check_snmp v2.2.1 (nagios-plugins 2.2.1)

The MIB information that SNMPWALK uses is in the /usr/share/snmp/mibs directory.

So my first questions is the syntax I am using for snmp_check correct?
Second question does snmp_check use the same MIB data that snmpwalk is using?

If both commands use the same MIB data, why is snmp_check throwing errors?

Re: Testing snmp_check plugin - No variable in MIB

Posted: Wed Jul 11, 2018 4:54 pm
by scottwilkerson
you did not include your SNMP version -P 2c

Code: Select all

/usr/local/nagios/libexec/check_snmp -C public -H 10.34.100.11 -P 2c -o 1.3.6.1.4.1.1991.1.1.1.1.18

Re: Testing snmp_check plugin - No variable in MIB

Posted: Thu Jul 12, 2018 7:01 am
by hbackus
Thank you for your response.

I get the same message with the -P (snmp_version) argument.

# /usr/local/nagios/libexec/check_snmp -C public -H 10.34.100.11 -P 2c -o 1.3.6.1.4.1.1991.1.1.1.1.18
SNMP OK - No Such Instance currently exists at this OID |

What do you think? :?

Re: Testing snmp_check plugin - No variable in MIB

Posted: Thu Jul 12, 2018 7:06 am
by scottwilkerson
Just re looked at your OP, you did a walk and what returned was the actual OID has another .0 at the end
run

Code: Select all

/usr/local/nagios/libexec/check_snmp -C public -H 10.34.100.11 -P 2c -o 1.3.6.1.4.1.1991.1.1.1.1.18.0
The walk will find all sub items, and the parent likely doesn't have a value

Re: Testing snmp_check plugin - No variable in MIB

Posted: Thu Jul 12, 2018 11:56 am
by hbackus
Thanks,

I obviously am missing the subtlety of SNMP? :oops:

I don't know if I would have ever caught the trailing .0.

Best Regards

Re: Testing snmp_check plugin - No variable in MIB

Posted: Thu Jul 12, 2018 2:50 pm
by scottwilkerson
hbackus wrote:Thanks,

I obviously am missing the subtlety of SNMP? :oops:

I don't know if I would have ever caught the trailing .0.

Best Regards
I almost missed it, SNMP is very finicky, everything has to be just so....

Glad it is resolved.

Locking