-1

I'm having trouble getting the check_snmp plugin to connect and return values. I'm running CentOS7, Nagios 4.0.8, check_snmp 2.0.3. While can snmpget and snmpwalk from the command line, check_snmp fails. Here are some examples...

snmpget:

# snmpget -v 3 -u myuser -x aes -X mypasswd -a md5 -A mypasswd -c Public -l AuthPriv 111.222.333.111 sysUpTime.0

...returns...

DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (10475998) 1 day, 5:05:59.98

snmpwalk:

# snmpwalk -v 3 -u myuser -x aes -X mypasswd -a md5 -A mypasswd -c Public -l AuthPriv 111.222.333.111 sysUptime

...returns...

DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (10473493) 1 day, 5:06:10.93

check_snmp:

 /usr/lib64/nagios/plugins/check_snmp -H 111.222.333.111 -o sysUpTime.0 -P 3 -l AuthPriv -U myuser -A mypasswd -a md5 -X mypasswd -x aes

...returns...

External command error: Error in packet
Reason: authorizationError (access denied to that object)
Failed object: DISMAN-EVENT-MIB::sysUpTimeInstance

When I run check_snmp with verbose on, I get...

/usr/bin/snmpget -Le -t 1 -r 5 -m ALL -v 3 [authpriv] 156.128.2.250:161 sysUpTime.0

check_snmp is clearly not constructing the snmpget command with the args that are being passed to it. I'm at a loss for why.

MrCleanX
  • 416
  • 2
  • 13

1 Answers1

1

The syntax is a little different for check_snmp sec level. Try:

-L authPriv

instead of:

-l AuthPriv

You can confirm this by invoking the help of the plugin with -h:

./check_snmp -h 
check_snmp v2.0.3 (nagios-plugins 2.0.3)
...
-L, --seclevel=[noAuthNoPriv|authNoPriv|authPriv]
...
Bruno9779
  • 1,551
  • 2
  • 14
  • 31
  • Stupid syntax!!! They use different arg labels just to mess us you don't they? ;) That did the trick. – MrCleanX Mar 11 '16 at 18:11
  • Yes, i really don't see why it is like this. Plus, many snpm v3 scripts gues seclevel from the provided arguments – Bruno9779 Mar 11 '16 at 21:28