logo

Manual Pages


Table of Contents

NAME

snmp - set and query SNMP agent variables

NAME

snmp - set and query SNMP agent variables

SYNOPSIS

snmp

snmp authtrap [ 0 | 1 ]

snmp community [ { add | delete } ro community ]

snmp contact [ contact ]

snmp init [ 1 ]

snmp location [ location ]

snmp traphost [ { add | delete } { hostname | ipaddress } ]

snmp traps [ on | off | reset | delete ]

snmp traps trapname.parameter value

snmp traps trapname on | off | reset | delete

DESCRIPTION

The snmp command is used to set and query configuration variables for the SNMP agent daemon (see na_snmpd(8)). If no options are specified, snmp lists the current values of all variables.

You use traps to inspect the value of MIB variables periodically and send an SNMP trap to the machines on the traphost list whenever that value meets the conditions you specify. The traphost list specifies network management stations that receive trap information.

OPTIONS

In all the following options, specifying the option name alone prints the current value of that option variable. If the option name is followed by one or more variables, then the appropriate action to set or delete that variable is taken.

Network Appliance recommends that you add all snmp commands to the end of the /etc/rc file. The last snmp command in the /etc/rc file should be as follows:

snmp init 1

This initializes the SNMP daemon with the values set using the snmp command and sends out a coldStart trap as described below.

authtrap [ 0 | 1 ]
Enables or disables SNMP agent authentication failure traps. To enable authentication traps, specify 1. To disable authentication traps, specify 0. Traps are sent to all hosts specified with the traphost option.

community [ add | delete ro
Adds or deletes communities with the specified access control type. Specify ro for a read-only community and rw for a read-write community. For example, to add the read-only community private, use the following command:

snmp community add ro private

Currently the SNMP SetRequest PDU is not supported, so all read-write communities default to read-only. The default community for the filer SNMP agent is public and its access mode is ro. Up to a maximum of eight communities are supported.

contact [ contact ]
Used to set the contact name returned by the SNMP agent as the System.sysContact.0 MIB-II variable.

init [ 1 ]
With an option of FB1, this initializes the snmp daemon with values previously set by the snmp command. It also sends a coldStart trap to any hosts previously specified by the traphost option. The last command in the filer's /etc/rc file should be as follows:

snmp init 1

On a query, init returns the value 0 if the SNMP daemon has not yet been initialized. Otherwise, it returns the value 1.

location [ location ]
Used to set the location name returned by the SNMP agent as the System.sysLocation.0 MIB-II variable.

traphost
[ add | delete hostname | ipaddress ]

To add or delete SNMP managers who receive the filer's trap PDUs. Specify the word add or delete as appropriate, followed by the host name or IP address. If a host name is specified, it must exist in the /etc/hosts file. For example, to add the host alpha, use the following command:

snmp traphost add alpha

No traps are sent unless at least one trap host is specified. Up to a maximum of eight trap hosts are supported.

On a query the traphost option returns a list of registered trap hosts followed by their IP addresses. If a host name cannot be found in /etc/hosts for a previously registered IP address, its name defaults to a string representation of its IP address.

traps on | off | reset | delete

Turns all user-defined traps on or off, or resets or deletes them

traps trapname.parameter value

Defines or changes a user-specified trap.

  Legal parameters, with a description of each, are as follows:
       Parameter                          Description
       var                        A trap s variable is the MIB variable
                                  that is queried to determine the trap's
                                  value. All MIB variables must be specified
                                  in the form snmp.oid, where oid is an OID
                                  (Object Identifier). A list of OIDs in the
                                  NetApp MIB is in the traps.dat file in the
                                  same directory as the MIB.
       trigger            A trap's trigger is a piece of code that
                                  determines whether the trap should send data.
                                  The following triggers are available:
                                       single-edge-sends data when the trap's
                                          target MIB variable's value crosses an
                                          a value that you specify.
                                       double-edge-enables you to have the trap
                                          send data when an edge is crossed in
                                          either direction (the edges can be
                                          different for each direction.
                                       level-sends data whenever the trap's value
                                          exceeds a certain level.
       edge-1
       edge-2             A trap's edges are the threshold values that
                                  are compared against during evaluation to
                                  determine whether to send data.
       edge-1-direction
       edge-2-direction
                      Edge-triggered traps only send data when the
                                  edges are crossed in one direction. By default,
                                  this is UP for the first edge and DOWN for the
                                  second edge. The direction arguments let you
                                  change this default.
       interval           The interval is the number of seconds between
                                  evaluation of the trap. A trap can only send
                                  data as often as it is evaluated.
       interval-offset
                      The interval offset is the amount of time in
                                  seconds until the first trap evaluation, and
                                  is zero by default. You can set it to a
                                  nonzero value to prevent too many traps from
                                  being evaluated at once (at system startup,
                                  for example).
       backoff-calculator
                      After a trap sends data, you might not want it
                                  to be evaluated so often anymore. For example,
                                  you might want to know within a minute of when
                                  a file system is full, but only want to be
                                  notified every hour that it is still full.
                                  There are two kinds of backoff calculators:
                                  stepwise and exponential.
       backoff-step
                          The number of seconds to increase the
                                  evaluation interval if you are using a step
                                  backoff. If a trap's interval is 10 and its
                                  backoff-step is 3590, the trap is evaluated
                                  every 10 seconds until it sends data, and once
                                  an hour thereafter.
       backoff-multiplier
                          The value by which to multiply a trap's
                                  evaluation interval each time it fires. If you
                                  set the backoff calculator to exponential-
                                  backoff and the backoff multiplier to 2, the
                                  interval doubles each time the trap fires.

The values of legal parameters are as follows, with the defaults in square brackets:
var
variable on which to trap must be of the form snmp.oid
trigger
double-edge-trigger or single-edge-trigger or level-trigger [NULL]
edge-1
numeric value for first edge [maxint]
edge-2
numeric value for second edge [0]
edge-1-direction
up or down [up]
edge-2-direction
up or down [down]
backoff-calculator
exponential-backoff or step-backoff or no-backoff [no-backoff]
backoff-step
step size, in seconds, for step-backoff [3600]
backoff-multiplier
m in the formula t[i+1] = t[i] * m, used in the exponential backoff algorithm [1]
interval
time, in seconds, between trap evaluations [3600]
interval-offset
time in seconds until first trap evaluation [0]

You can trap on any numeric MIB variable.

All user-defined traps are sent through the userDefined trap in the NetApp MIB, which has the OID of 1.3.6.1.4.1.789.0.2. The trap itself contains the source entity (the filer). The trap data contains a string of the following form:

name == value
name is the name specified by the user. value is the value of its MIB object at the time the trap fires.

You use standard SNMP tools to receive and examine these traps.

You can enter trap parameters in any order. They are never evaluated until you specify a variable and an evaluation interval.

traps trapname on | off | reset | delete

Turns the specified trap on or off, reload it from the trap database, or delete it.

EXAMPLES

To define the cpuBusyPct trap and set it to point at the MIB object that returns the cumulative CPU busy time percentage of the filer, use the following command:

traps cpuBusyPct.var snmp.1.3.6.1.4.1.789.1.2.1.3.0

To set the evaluation interval of cpuBusyPct to one minute, use the following command:

traps cpuBusyPct.interval 60

To prompt cpuBusyPct to fire whenever its value exceeds a value (which has not yet been specified), use the following command:

traps cpuBusyPct.trigger level-trigger

You can set a firing threshold to a percentage of a returned value. The following command sets the cpuBusyPct trap's firing threshold at 90%. This means that whenever cpuBusyPct is evaluated and a GET to the MIB entry it points to returns a number in the range 90..100, the trap fires.

traps cpuBusyPct.edge-1 90

To cause cpuBusyPct to become active, use the following command:

traps cpuBusyPct on

To use a backoff and not hear about the busy percentage every 60 seconds, use the following command:

traps cpuBusyPct.backoff-calculator step-backoff

To cause the trap to be evaluated only every 30 minutes after the first firing (60 + 1740 == 1800 seconds, or thirty minutes), use the following command:

traps cpuBusyPct.backoff-step 1740

To Define badfans and set its MIB object, use the following command:

traps badfans.var snmp.1.3.6.1.4.1.789.1.2.4.2.0

A double-edge-triggered trap fires once when the first edge is crossed and again when the second edge is crossed. To define badfans as a doubleedge-triggered trap, use the following command:

traps badfans.trigger double-edge-trigger

To cause badfans to fire when the number of bad fans in the filer goes from zero to nonzero (it still fires if the number of fans suddenly goes from zero to two), use the following command:

traps badfans.edge-1 1

You can cause badfans to fire again whenever the number of bad fans in the filer becomes zero again. By default the crossing direction for the first edge is up, and for the second is down; this is what you want, so there is no need to specify the edge direction, and you use the following command:

traps badfans.edge-2 0

To cause badfans to be evaluated every 30 seconds, use the following command:

traps badfans.interval 30

A typical set of snmp commands in the /etc/rc file looks like the following:

  snmp contact 'Network Manager'
  snmp location 'Bldg 2. Lab 3a'
  snmp community add ro private
  snmp traphost add snmp-mgr1
  snmp traphost add snmp-mgr2
  snmp init 1

FILES

/etc/rc
Startup command script where SNMP commands must be added
/etc/hosts
Hosts name database

CLUSTER CONSIDERATIONS

The filers in a cluster can have different settings for the snmp options.

SEE ALSO

na_partner(1), na_autosupport(8), na_snmpd(8), na_rc(5)


Table of Contents