Problems with check_snmp

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
garresmi
Posts: 1
Joined: Mon Jul 06, 2015 10:54 am

Problems with check_snmp

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Problems with check_snmp

Post 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.
Former Nagios Employee
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Problems with check_snmp

Post by Box293 »

Public123$
It's the $ in your password causing the issue.

Try enclosing the password in 'single quotes'.

Or

\$$
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked