Newbie question - check_snmp syntax

Patrick Morris patrick.morris at hp.com
Fri May 16 02:44:25 CEST 2008


On Thu, 15 May 2008, mrinal devadas wrote:

> Hi all,
> Am attempting to setup a Nagios server to accept SNMP traps from a NetApp
> controller. Need help with the syntax to be used for check_snmp.
> 
> My commands.cfg file has,
> define command{
>         command_name    check_snmp
>         command_line    $USER1$/check_snmp -H $ARG1$ -P 2c -L noAuthNoPriv
> -d ! -m $ARG2$
>         }
> 
> My netapp.cfg file has,
> define service{
>         use                     generic-service ; Inherit values from a
> template
>         host_name               gx3
>         service_description     Uptime
>         check_command           check_snmp!gx3!sysUpTime.0
>         }
> 
> I get the following error message on Nagios,
> Status Information:    SNMP problem - No data received from host
> CMD: /usr/bin/snmpget -t 1 -r 5 -m sysUpTime.0 -v 2c [authpriv] gx2:161
> 
> What am I doing wrong?

First, a couple points:

NMP traps are not something you can get using check_snmp.  They are sent
from a device to something that listens for SNMP traps, and aren't
something you can poll for.  In the example you gave, however, it 
appears you're polling for the sysUpTime.0 OID from SNMP, which is not 
a trap, so maybe you're just using the wrong terminology. If you are
trying to receive traps, though, your current approach will never work.

Now, if you're just polling SNMP for values, you've got a workable
start. However, The result you say you're receiving in Nagios cannot be
the result of the configs you've supplied.  You're also mixing commands
in a way that doesn't make much sense. For example, you specify to use
SNMP version 2, but also include the -L switch, which only applies to
SNMP version 3.  You're also going to have trouble with the "-d !" part
of the command line, probably, and I doubt you even need it.  You're
also not specifying the OID you want to poll.  The "-m" flag specifies a
MIB to load -- a MIB is generally a file containing information about
the OIDs available on a device, but the "-o" switch is the one to use to
specify the data you want returned.

It's also unclear what, if anything, you've done on the NetApp as far as
SNMP configuration, so that could very well be a problem as well. 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list