Table of Contents


snmp – set and query SNMP agent variables



snmp authtrap [ 0 | 1 ]

snmp community [ add ro community ]

snmp community [ delete { all | ro community } ]

snmp contact [ contact ]

snmp init [ 0 | 1 ]

snmp location [ location ]

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

snmp traps [ walk prefix ]

snmp traps load filename

snmp traps [ { enable | disable | reset | delete } trap_name ]

snmp traps trapname.parm value

Note that trapname may not contain embedded periods (‘.’).


The snmp command is used to set and query configuration variables for the SNMP agent daemon (see snmpd ). 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.

The priority level of a build-in trap can be found by inspecting the ones digit of the trap number sent to the traphost, or from the trap definition in the Data ONTAP MIB.

       — 1 emergency        — 2 alert        — 3 critical        — 4 error        — 5 warning        — 6 notification        — 7 information        — 8 debug 


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.

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 | rw community ]

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. A maximum of eight communities are supported.

contact [ contact ]

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

init [ 0 | 1 ]

With an option of 1, 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.

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 ]

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 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.

snmp traps

Displays all of the user-defined traps.

snmp traps [ walk prefix ]

Display the current traps and their settings. If walk and prefix are specified, the command displays only traps with names beginning with prefix.

snmp traps load filename

Loads traps from the file filename; Each line in filename must consist of lines with the same syntax as the snmp traps command, but with the "snmp traps" omitted from the line.

snmp traps { enable | disable | reset | delete }

Enables, disables, resets or deletes all userdefined traps.

snmp traps { enable | disable | reset | delete } trapname

Enables or disables the specified trap. Or allows the specified trap to be reloaded from the trap database or deleted. Note that trapname may not contain embedded periods (‘.’).

snmp traps trapname.parm value

Defines or changes a user-specified trap.

  Legal parms,  with a description of each,  are as follows:        Parm                          Description        var/OID                  The MIB object that is queried to determine the trap’s                       value. All MIB objects must be specified                       in the form snmp.OID. A list of OIDs in the                       Data ONTAP MIB is in the traps.dat file in the                       same directory as the MIB.        trigger                       Determines whether the trap should send data.                       The following triggers are available:                            single-edge-trigger sends data when the trap’s                            target MIB variable’s value crosses an                            a value that you specify.                                 double-edge-trigger 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-trigger 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.                       The default for edge-1 is the                       largest integer and the default for edge-2                       is 0.        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 number of seconds between evaluations of the trap.                       A trap can only send data as often as it is                       evaluated.        interval-offset                       The amount of time in seconds until the first trap                       evaluation. Setting it to a nonzero value will                       prevent too many traps from being evaluated at                       once (at system startup,  for example). The                       default is 0.        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:                       step-backoff and exponential-backup                       in addition to no-backoff.        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.  The default is 3600.        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 default is 1.        rate-interval                       If this value is greater than 0,  the samples of data                       obtained at the interval points (set using the                       interval parameter) for a trap variable are used                       to calculate the rate of change. If the calculated                       value exceeds the value set for edge-1 or edge-2                       parameters,  the trap is fired. The default is 0.        priority                       emergency or (in descending order of severity)                       alert or                       critical or                       error or                       warning or                       notification (default) or                       informational or                       debug        message                       Message associated with the trap. The message could                       be a string or of the form snmp.oid. If an OID is                       specified,  the result of evaluating that OID is                       sent. The default message is a string that shows                       the OID value that triggered the trap.  

You can trap on any numeric MIB variable.

All user-defined traps are sent with a variable binding to the userDefined trap in the Data ONTAP MIB, which has the OID of 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.


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:

snmp traps cpuBusyPct.OID snmp.

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

snmp 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:

snmp 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.

snmp traps cpuBusyPct.edge-1 90

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

snmp traps enable cpuBusyPct

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

snmp 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:

snmp traps cpuBusyPct.backoff-step 1740

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

snmp traps badfans.OID snmp.

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 double-edge-triggered trap, use the following command:

snmp 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:

snmp 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:

snmp traps badfans.edge-2 0

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

snmp traps badfans.interval 30


Hosts name database


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


The command completed successfully.

The command failed due to unusual circumstances.

There was a syntax error in the command.

There was an invalid argument provided.

No result was available.


partner , autosupport , snmpd .

Table of Contents

Copyright © 1994-2008 NetApp, Inc. Legal Information

7-mode Manual Pages , , , ,

  1. No comments yet.
  1. No trackbacks yet.

This site is not affiliated or sponsored in anyway by NetApp or any other company mentioned within.
%d bloggers like this: