Library Table of Contents Index Previous Page (Alt-p) Next Page (Alt-n) Comments

Defining or modifying a trap

Ways to define or modify a trap  Top

You can define traps or modify traps you have already defined by entering values in one of the following ways:

You must supply the following elements when creating or modifying traps.

Viewing and modifying trap values at the command line  Top

To view or modify traps using the command-line interface, complete the following step.

Step

Action

1

At the filer command line, enter the following command:

snmp traps {options variables}

For more information about snmp traps parameters, see Command syntax for SNMP trap parameters.

Viewing or modifying trap values with FilerView  Top

To define or modify traps using FilerView, complete the following steps.

Step

Action

1

In FilerView, click SNMP in the list on the left.

2

In the list under SNMP, click Traps.

3

If you want to....

Then...

Create a new trap

  1. Click Add.
  2. In the Add an SNMP Trap window, enter the requested information and Click Add.

View or modify an existing trap

  1. Click Manage for the trap you want.
  2. In the Manage SNMP Traps window, click Modify.

Example of trap definitions  Top

The following command-line example sets a group of traps. The trap descriptions are numbered in brackets.

The same parameters can be entered using FilerView.

Example


 
snmp traps cifstotalops.var snmp.1.3.6.1.4.1.789.1.7.3.1.1.1.0 [1]
snmp traps cifstotalops.trigger level-trigger
snmp traps cifstotalops.edge-1 1000000 [4]
snmp traps cifstotalops.interval 10 [2]
snmp traps cifstotalops.backoff-calculator step-backoff [5]
snmp traps cifstotalops.backoff-step 3590 [5]
snmp traps cifstotalops.rate-interval 3600 [3]
snmp traps cifstotalops.priority alert
snmp traps cifstotalops.message snmp.1.3.6.1.4.1.789.1.7.3.1.1.1.0

Explanation

A cifstotalops trap [1] is evaluated every 10 seconds [2]. The value received from the previous evaluation and the current value are used to calculate the number of CIFS operations per hour [3]. If the number exceeds one million [4], the trap fires and continues to fire every hour [5] until the total number of CIFS operations drops below one million.

Command syntax for SNMP trap parameters  Top

The following table lists the SNMP trap commands available in Data ONTAP. If you specify one or more values for an option of the SNMP commands, the value of that option is set or changed. However, if no values are specified, the current value of that option is returned.

Command

Description

snmp traps

Displays the list of user-defined traps set in Data ONTAP.

snmp traps [enable|disable| 
reset|delete] [trapname]

Enables, disables, resets, or deletes the trapname trap. If you do not specify the trapname trap, all traps defined so far are acted on.

snmp traps walk prefix

Walks (traverses in order) the trap list by prefix; that is, lists all traps that have names beginning with prefix.

snmp traps load 
trap_list_filename

Loads a set of traps from a text file. The trap_list_filename file contains a list of traps without the snmp traps command preceding each trap. If the specified file name is defaults, traps are read from the /etc/defaults/traps file.

snmp traps trapname.parm value

Defines or changes a user-defined trap parameter. See SNMP trap parameters.

Defining and modifying traps in a configuration file  Top

Network Appliance recommends that you define traps in a configuration file, which is then loaded with the snmp traps load command. If you define and load traps this way, Data ONTAP will automatically back up your SNMP configuration in snapshots, make it easy to transfer user-defined traps to other filers, and simplify recovery of SNMP configurations if there is some kind of disaster.

To create a trap configuration file, follow these steps.

Step[

Action

1

Create a traps configuration file on the filer -- for example, /etc/mib/mytraps. The name and location of the file is at your discretion.

2

Enter the traps in the configuration file in the following form:

trapname.parm value

That is, use parameters of the snmp traps command without the command name.

For example, to set the cifstotalops trap listed in the previous command example, enter the following lines in your configuration file:

cifstotalops.var snmp.1.3.6.1.4.1.789.1.7.3.1.1.1.0
cifstotalops.trigger level-trigger
cifstotalops.edge-1 1000000
cifstotalops.interval 10
cifstotalops.backoff-calculator step-backoff
cifstotalops.backoff-step 3590
cifstotalops.rate-interval 3600
cifstotalops.priority alert
cifstotalops.message snmp.1.3.6.1.4.1.789.1.7.3.1.1.1.0
3

Test each line of the file by entering the snmp traps command at the command line or by specifying the trap with FilerView. Make corrections as needed.

4

Load the configuration file with the snmp traps load command. For example:

snmp traps load /etc/mib/mytraps

Library Table of Contents Index Previous Page (Alt-p) Next Page (Alt-n) Comments