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
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.
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
The values of legal parameters are as follows, with the defaults in square brackets:
single-edge-trigger, level-trigger [NULL], or edge-1 numeric value for first edge [maxint]
step-backoff, or no-backoff
[no-backoff]
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.
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 double-edge-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