1

I'm trying to add a nagios command to use snmpv3 for monitoring printer status messages. When using the check_snmp command, I get the following error:

External command error: snmpget: Unknown Report message

Here is the command I'm typing in:

./check_snmp -P 3 -H <hostname> -L authPriv -U snmpuser -A snmppassword -X snmppassword -o 1.3.6.1.4.1.11.2.4.3.1.2.0 -C public -d "STRING:" -a MD5

These values for auth key, private key, username, etc all work when using snmpwalk. Can someone enlighten me as to what that error message really means?

EDIT: It looks like check_snmp isn't taking my v3 credentials when passing over to snmpget. Here is my input with the verbose option:

./check_snmp -H <hostname> -o 1.3.6.1.2.1.2.2.1.10.1 -C public -m ALL -P 3 -L authPriv -U snmpuser -a MD5 -A snmppassword -x DES -X snmppassword -v

And here is the output:

/usr/bin/snmpget -t 1 -r 5 -m ALL -v 3 [authpriv] <hostname>:161 1.3.6.1.2.1.2.2.1.10.1
External command error: snmpget: Unknown Report message

So I guess now my question would be: why isn't check_snmp passing all the commandline options to snmpget?

John
  • 111
  • 1
  • 5
  • Not all that familiar with v3, but why are you providing the password twice, once with the -A option and once with the -X options. Does the community and OID work with snmp v2? (just to make it simple) – SpacemanSpiff Feb 15 '11 at 01:11
  • snmpv3 uses both an authentication key and a privacy password, mine just happen to be the same. Everything works with v2, but I'm trying to be more secure and use v3. – John Feb 15 '11 at 01:41
  • I just found out that check_snmp isn't propagating the entries to the snmpget command. I've edited the question with a clearer description of the problem. – John Feb 15 '11 at 01:43

2 Answers2

1

Strange that it isn't passing all the arguments for you. Old version of nagios-plugins, perhaps?

Fortunately you can probably re-use something I just put together that solves a different problem. check_snmp doesn't obey your smnp.conf file.

I wrote a check_snmp.pl script that behaves similarly to check_snmp, and works with snmp v3, and uses the values in your snmp.conf file. Here is the synopsis:

http://cormander.com/2011/11/a-nagios-snmp-plugin-that-obeys-snmp-conf/

And a direct link to the check_snmp.pl script:

http://cormander.com/wp-content/uploads/2011/11/check_snmp.pl_.txt

Hope somebody finds this useful.

0

I could never get check_snmp to work with version 3 SNMP. To fix my issue, I created my own plugin based off of the following sample for HP Printer SNMP checking:

http://www.koders.com/c/fid3CAA98A63980B5952800E7C72CDDE8E2BAD3A0B9.aspx

John
  • 111
  • 1
  • 5