Page 1 of 1

Problems with check_snmp

Posted: Mon Aug 08, 2016 1:56 pm
by garresmi
Hi Everyone.
I recently upgraded my installation from 3.2.1 to 4.2.0. On my old installation, the check_snmp plugin worked fine. I defined a separate command to use version 2 (but still using the same script), and now all of a sudden after the upgrade, the version 2 checks don't work. if I manually execute the script, I get the following:

Code: Select all

./check_snmp -H <IP Address> -P 2c -C Public123$ -o 1.3.6.1.4.1.9.2.1.8.0
SNMP OK - 81118420 | 1.3.6.1.4.1.9.2.1.8.0=81118420
But if I use the command I've defined, it returns either Unknown Object Identifier (Index out of range: 15$ (ifIndex)) or Unknown Object Identifier (Sub-id not found: enterprises -> 0$)

Code: Select all

Command Definition:
define command{
        command_name check_snmpv2
        command_line $USER1$/check_snmp -P2c -H $HOSTADDRESS$ -C $ARG1$
}

Service Definition:
define service{
use                     generic-service
host_name               <Hostname>
service_description     Memory Usage
check_command           check_snmpv2!Public123$ -o 1.3.6.1.4.1.9.2.1.8.0
servicegroups           snmp
}
All the SNMP settings on the client end are identical, and snmpget works fine for this OID. I also tried setting the command to use version 1, and the same issue occurred.
I can't figure out why this wouldn't work, especially considering that it worked fine on the old installation.
I'd appreciate any help you guys can give me.

Re: Problems with check_snmp

Posted: Mon Aug 08, 2016 2:19 pm
by rkennedy
Could you try putting a space between the -P and 2c in your check_snmpv2 command definition?

Code: Select all

check_snmp -P2c
change to -

Code: Select all

check_snmp -P 2c
That's the only visible difference I can see. Let us know how that goes.

Re: Problems with check_snmp

Posted: Mon Aug 08, 2016 4:57 pm
by Box293
Public123$
It's the $ in your password causing the issue.

Try enclosing the password in 'single quotes'.

Or

\$$