logo

Manual Pages


Table of Contents

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 sets and queries 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 to 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, 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 later.

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 }
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 private read-only community, 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 eight communities are supported.

contact contact
Sets the contact name returned by the SNMP agent as the System.sysContact.0 MIB-II variable.

init [ 1 ]
With an option of 1, 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 been initialized. Otherwise, it returns the value 1.

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

traphost { add | delete } { hostname | ipaddress } Adds or deletes 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 you specify a host name, it must exist in the /etc/hosts file. For example, to add the alpha host, use the following command:

snmp traphost add alpha

No traps are sent unless at least one trap host is specified. Up to 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.

  The descriptions of legal parameters 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).

trigger
A trap's trigger is a piece of code that determines whether the trap should fire. The following triggers are available: single-edge: fires when the trap's target MIB variable's value crosses a value that you specify. double-edge: fires when the trap's target MIB variable's value crosses either of two values that you specify. The edges are usually different for each direction. level: fires whenever the trap's value meets or 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 fire.

edge-1-direction

edge-2-direction
Edge-triggered traps only fire 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 evaluations of the trap. A trap can only fire 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 fires, 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 backoff step is 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 fires, and once an hour thereafter until it stops firing, at which time the evaluation interval is reset.

backoff-multiplier The backoff multiplier is 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 until it stops firing, at which time the evaluation interval is reset.

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, for example:

trigger, double-edge-trigger,

single-edge-trigger, level-trigger [NULL], or 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,

step-backoff, or no-backoff
[no-backoff]

backoff-step
step size, in seconds, for step-backoff [3600]

backoff-multiplierm in the formula t[i+1] = t[i] * m, used in the exponential backoff algorithm [1]

interval
time, in seconds, between trap evaluations

interval-offset
time in seconds until first trap evaluation [0]

You can set a 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 and to discover object OIDs.

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, reloads it from the trap database, or deletes 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

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 that 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 it is down. This is what you want; therefore, you do not 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