Configuring Traps

 



 

Overview

 

In addition to retrieving data from the managed resource and sending response to them, agents also have the ability to send unsolicited messages to managers when they detect some significant event. An unsolicited message of this sort is called Trap.

 

You can configure the simulated agents in the network so that the agent will send traps when it satisfies the specified condition. In real world, a trap will be sent based on a real event. When simulating traps the trap needs an event. This event will act as the trigger to fire traps. In this aspect every trap that is configured is associated with a MIB node and takes the OID of the node as the associated variable. You can configure the event that should fire the trap (events : Get / GetNext / Set on trap variable). Whenever the event happens on the associated trap variable, the configured trap will be fired.

 

You can generate traps on the following conditions:

Enabling/Disabling Trap Service

 

The SNMP Agent Simulator/ Network Designer provides option to enable/disable the execution of  traps configured in the SNMP agent, at agent runtime. If  trap service is disabled, the agent will not check for trap configurations before sending the response. Hence, you can use this option to improve the performance of the SNMP agent, if traps are not required to be executed.

 

By default, the service is enabled and the traps configured (if any), will be executed.  To disable the service,

Note:

  1. The options in the Initialize Services dialog will be disabled when the SNMP agent is started.

  2. If Trap Service is deselected, the traps configured in behavior scripts are also not executed.

 

Configuring Traps

 

You can configure Request based, Threshold based and Timer based traps from the SNMP Agent Simulator or Network Simulator. To configure the same,

  1. Choose the option Configure --> Traps from the menu bar or click on the Configure Traps icon in the Tool bar. The Trap Configurations dialog is displayed . This dialog will list the default traps defined in the MIB.

  2. To configure a new trap, click Add . The Configure Trap dialog opens up with three icons displayed on the left side for Request-based , Threshold-based and Timer-based traps. Select the required icon.

  3. Configure the General Parameters that are common for Request based, Threshold based and Timer based Traps.

  4. To configure Request Based Traps, specify Request Based Parameters.

  5. To configure Threshold Based Traps, specify Threshold Based Parameters..

  6. To configure Timer Based Traps, refer to Timer Based Parameters.

General Parameters

coldStart (0),
warmStart (1),
linkDown (2),
linkUp (3),
authenticationFailure (4),
egpNeighborLoss (5),
enterpriseSpecific (6).

Request Based Parameters

 

Request based traps are traps that are generated when a request ( Get and Set / Set only ) is made by the Manager on the simulated agent. To configure Request based parameters, enter the following details in the check boxes :

Threshold Based Parameters

 

Threshold based traps are traps that are generated when the value in the selected OID satisfies the specified threshold condition and the threshold value. To configure threshold parameters, enter the following details in the check boxes :

For types other than Octet String, Object ID and IP Address, the following threshold conditions are listed:

Threshold Value : Specify the threshold value. For custom range, the lower threshold value and higher threshold value must be specified.

Timer Based Parameters

 

Timer based traps are traps that are generated at the configured time. In timer based traps the OID uniquely identifies the configured traps. To configure timer parameters, enter the following details in the check boxes :

Note:

  1.  By default, the traps will be sent with the IP Address of the system from which the traps are generated. To configure the "from IP Address" of the traps, refer to Configuring Global Trap Settings.

  2.  If the total traps and timer interval field is blank, a single trap is sent. If the Timer interval is specified as "1" and the total traps field is blank, total number of traps/Informs is taken as Infinity.

  3. At Network Simulator startup, the timer traps with elapsed time will be executed.

  4. Selecting the device right-click option SNMP -> Stop timer Traps will stop the execution of timer traps in Network Simulator.  To stop the execution of timer traps in all devices, right-click on the blank network area and select Stop All timer traps.

 

Adding Variable Bindings

 

Variable Bindings or Varbinds is an additional information that is sent to the manager along with the trap or inform. It can be value of the selected MIB nodes. This value is sent to the manager along with the trap or Inform. By default, SysUpTime and SNMP Trap OID is sent as varbinds for v2 Traps.

 

The Varbinds dialog can be invoked from the add/modify trap dialog and also from the trap configuration dialog .

 

To configure varbinds,

To modify Varbinds,

To Delete Varbinds

Configuring Global Trap Settings

 

The SNMP Agent Simulator provides option to configure the agent IP address and manager details of traps, globally. It also provides option to send all timer traps with updated agent values in varbinds.  

 

Agent IP Address of Traps

 

By default, traps will be sent with the IP Address or host name of the system from which the traps are generated. The simulator provides you the option to configure the IP address or host name, with which the traps are to be sent. This property will not be stored in the simulator. Every time when the simulator is invoked, the IP address/host name has to be specified. All traps will be sent from the simulated agent with the specified address.

 

To configure "Agent IP Address" of traps globally,

Note: The default "from IP Address" is "localhost". If the specified address is not available, traps will be sent with the default address.

 

Manager Details

 

By default, a trap will be sent to the manager name, port and community specified for each trap in the Trap Configuration dialog.  If you want all the traps to be sent to the same set of managers, you can specify the manager details in the Trap Settings dialog. Adding manager details to this dialog, will sent the traps only to the managers configured in this dialog.

 

To configure Manager Details globally,

Sending Timer traps with Updated Agent Value in Varbinds

 

By default, if timer traps are configured with agent value in varbinds, the simulator will not check for the updated agent value, every time the trap is sent. Hence, all the timer traps will be sent with the agent value which is read at the startup time.

 

Selecting the option Sending timer traps with updated Agent values, in Settings -> Trap Settings dialog, will send the timer trap every time with the updated agent value. Since, the simulator checks for the agent value each time the trap is sent, performance will be reduced to some extent depending on the number of times the timer trap is sent.

 

Loading the Recorded Traps

 

You can record SNMP v1/v2c traps with the Trap Recorder. The recorded traps can be stored in XML files and loaded in the trap configuration dialog of the SNMP Agent Simulator and Network Designer as request-based, threshold-based and timer-based traps.

 

Refer the topic, Trap Recorder -> Replaying Traps in Simulator

 

Sending Traps

 

The traps configured in the Trap Configuration dialog, can be sent in the following ways.

 

Using Send Button

 

By using the Send button in the Trap Configuration dialog, you can select and send any trap irrespective of the condition configured. The selected traps will be sent to the specified manager at the port specified.

 

Note: The traps can be sent only when the agent is started. s

 

Sending Request Based Traps

 

A request based trap will be generated when a request is made on the configured node. For example : A request based trap is configured with the following values:

 

Associated variable is sysUpTime of the RFC1213-MIB with OID .1.3.6.1.2.1.1.3

Trap Version is Snmp V1

Generic Type is coldStart(0)

Request Type is Get and Set.

Total traps configured is 100

Time Interval is 2000 milliseconds.

 

When a Get/Set request is made from the Manager, on the variable sysUpTime, 100 SNMP v1 traps with Generic Type coldStart, will be generated with a time interval of 2 seconds between the traps. The traps will be sent to the managers running at the specified ports.

 

Sending Threshold Based Traps

 

A Threshold Based Trap will be generated when the selected OID satisfies the specified threshold condition and the threshold value. For example : A threshold based trap is configured with the following values:

 

Associated Variable is ifAdminStatus of the IfTable of RFC1213 MIB with OID .1.3.6.1.2.1.2.2.1.7

Trap Version is Snmp V1

Generic Type is linkDown(2)

Threshold Condition is Equal To Threshold Value is 2

Total Traps configured is 10

Time Interval is 5000 milliseconds

 

If the value of the OID .1.3.6.1.2.1.2.2.1.7 equals to 2, 10 SNMP v1 traps with Generic Type linkDown, will be generated with a time interval of 5 seconds between the traps. The traps will be sent to the managers running at the specified ports.

 

Sending Timer Based Trap

 

Timer based traps are generated at the configured time. For example : A Timer Based trap is generated with the following values:

 

Associated Variable is sysName of the RFC1213-MIB with OID .1.3.6.1.2.1.1.5. In timer traps, the OID is specified to uniquely identify the trap.

Trap Version is Snmp V1

Generic Type is coldStart(0)

Starting Time is 20 - Mar 2003 ; 17 : 00 : 00

Periodically Send Once in 2 Days

Total Traps configured is 10

Time Interval is 5000

 

When the specified date and time is reached (20 th Mar, 2003 at 17 hrs), 10 SNMP v1 traps with Generic Type coldStart, will be generated with a time interval of 5 seconds between the traps. The traps will be periodically send once in two days, to the managers running at the specified ports.  

 

Note:

 

1. The generated traps can be viewed from the Trap Viewer of the Mib Browser.

2. Selecting the device right-click option SNMP -> Stop timer Traps will stop the execution of timer traps in Network Simulator. To stop the execution of timer traps in all devices, right-click on the blank network area and select Stop All timer traps option .

 

Modifying and Deleting Traps

 

You can modify an existing trap to change the configured values.

You can delete existing traps from the Trap Configuration table.

Generating Default Traps

 

Default Traps are traps and notifications defined for a particular variable in the MIB. You can view and send default traps defined in the loaded MIB file using the Default Trap dialog.  It will send the traps with the default values.

 

Note: Default traps can be sent only when the agent is started. This feature is not supported in Network Designer.

 

To generate default traps in SNMP Agent Simulator,

 

Viewing Traps

 

The generated traps can be viewed from the Trap Viewer.  The Trap viewer must be started at the specified port before sending the traps. The Trap Viewer can listen to one or more port at a time and the traps can be sent from any host.

 

Trap Viewer is not integrated in the SNMP Agent Simulator. To view the traps, use the Trap viewer integrated with SNMP MIB Browser. Refer to Mib Browser -> Trap Handling -> Viewing Traps section, to learn more about the Trap viewer.

 

The Trap Viewer is integrated in Network Designer to view the Traps received from network elements.

 

To open the Trap Viewer



Copyright © 1996-2006, AdventNet Inc. All Rights Reserved.