Check_snmp reverts to v1

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
manimaren
Posts: 1
Joined: Thu Mar 02, 2017 12:23 am

Check_snmp reverts to v1

Post by manimaren »

Hi,

I am having a problem with check_snmp.

When I issue snmpget I have no issues as below

[root@localhost ~]# snmpget -Le -r 3 -v 2c -c testing 10.10.10.20 sysUpTimeInstance
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (219524) 0:36:35.24
[root@localhost ~]#

But when I issue with check_snmp, it reverts to v1 as below

[root@localhost libexec]# ./check_snmp -H 10.10.10.20 -t 90 -v 2c -C testing -o sysUpTimeInstance
/usr/bin/snmpget -Le -t 90 -r 5 -m ALL -v 1 [context] [authpriv] 10.10.10.20:161 sysUpTimeInstance
CRITICAL - Plugin timed out while executing system call
[root@localhost libexec]#

Anything I define wrongly?

Please advice.

Thanks.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Check_snmp reverts to v1

Post by mcapra »

Are you sure this is a Nagios Log Server question? I don't think check_snmp gets used anywhere in Nagios Log Server.

Your check_snmp command is using -v for the SNMP version, but this argument doesn't represent the SNMP version used:

Code: Select all

Usage:
check_snmp -H <ip_address> -o <OID> [-w warn_range] [-c crit_range]
[-C community] [-s string] [-r regex] [-R regexi] [-t timeout] [-e retries]
[-l label] [-u units] [-p port-number] [-d delimiter] [-D output-delimiter]
[-m miblist] [-P snmp version] [-L seclevel] [-U secname] [-a authproto]
[-A authpasswd] [-x privproto] [-X privpasswd]
You might instead try using the [-P snmp version] argument like so:

Code: Select all

[root@xi-stable ~]# snmpget -v 2c -c welcome2 192.168.67.105 sysUpTimeInstance
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (130723671) 15 days, 3:07:16.71

...

[root@xi-stable ~]# /usr/local/nagios/libexec/check_snmp -H 192.168.67.105 -t 90 -P 2c -C welcome2 -o sysUpTimeInstance
SNMP OK - Timeticks: (130733644) 15 days, 3:08:56.44 |
Former Nagios employee
https://www.mcapra.com/
Locked