|
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:
Default traps
Request based traps
Threshold based traps
Timer based traps
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,
Select Operations -> Initialize Services in SNMP Agent Simulator or select Run-> Initialize Service in Network Designer.
The Initialize Service dialog is displayed.
Deselect the option Enable SNMP Trap Service.
Start the Agent. Now, the traps configured in the simulator, will not be executed.
|
|
Note:
|
You can configure Request based, Threshold based and Timer based traps from the SNMP Agent Simulator or Network Simulator. To configure the same,
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.
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.
Configure the General Parameters that are common for Request based, Threshold based and Timer based Traps.
To configure Request Based Traps, specify Request Based Parameters.
To configure Threshold Based Traps, specify Threshold Based Parameters..
To configure Timer Based Traps, refer to Timer Based Parameters.
Associated Variable : The trap variable or associated variable is a unique identifier, the SNMP operation on which will trigger the trap. Browse and select the required scalar/columnar node from the MIB tree and click OK. The OID of the selected node will be displayed as the trap variable.
Trap
Version : Select the Trap Version from the list displayed. If the
trap version is v1, the trap type must be specified as either Generic
type or Specific type. The default trap version is SNMPv1.
If the trap version is v3, the v3 agent must be started and the user
name and context name of the v3 user must be specified. Please refer the
topic Simulating a v3 Agent, to know
more about starting the v3 agent, the default user names and password,
and configuring new user names and password.
Generic Type : If the trap type value is zero through five, then the trap is one of the generic SNMP traps defined by the snmp group of MIB-II and the Specific trap type will be zero. If the trap type value is six, then the trap is an enterprise-specific trap that is defined in a private MIB.
coldStart (0),
warmStart (1),
linkDown (2),
linkUp (3),
authenticationFailure (4),
egpNeighborLoss (5),
enterpriseSpecific (6).
Specific Type : Specify an integer value for the enterprise-specific trap that is defined in a private MIB.
Enterprise OID : The OID specified in the Enterprises field indicates exactly which management enterprise defines the trap.
Manager Name : Specify the manager name. If the Manager is running on the same machine it will contain the value localhost. If the Manager is running on a different machine specify the manager name or IP address of that machine.
Manager Port : The default manage port is 162. If the manager is running on a different port, specify the port number.
Community : Specify the community name of the manager.
Variable Bindings : It enables the user to add more varbinds to the trap other than the trap variables/objects It is optional. To know more about adding Variable Bindings, refer the topic "Adding Varbinds".
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 :
Request Type : The simulated trap needs an operation ( Get or Set ) on a MIB node. This will be the trigger based on which the trap will be generated when any request is made on the selected OID on which the operation will be performed. Choose the Request type from the following options:
Get & Set
Set only.
Total Traps: Specify the number of traps that you want to send. Example: 100. It is optional. If total traps is not specified, the traps will be sent infinite number of times.
Time Interval : You can also specify the time interval between the traps that are to be sent. The time interval option is available in Minutes, seconds and Milliseconds. Eg: 1000 Milliseconds. It is optional.
Click Ok to add the request based trap.
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 :
Threshold
Condition and Value : Specify the threshold condition and value
based on which the trap will be sent.
Threshold Condition : The threshold conditions listed depend upon the
type of the selected trap variable. For a node of type Octet String, Object
ID and IP Address, the conditions displayed are :
Equal To
Not Equal To
For types other than Octet String, Object ID and IP Address, the following threshold conditions are listed:
Equal To
Not Equal To
Greater than
Less than
Custom Range: For Custom range, a trap will be sent if the value of the associated trap variable is not within the lower and upper threshold value. For example, if the lower threshold value is 10 and upper threshold value is 20, a trap is sent if the associated trap variable value is less than or equal to 10 (or) greater than or equal to 20.
Threshold Value : Specify the threshold value. For custom range, the lower threshold value and higher threshold value must be specified.
Total Traps : Specify the number of trap that you want to send. Eg: 100. It is optional. If you leave the number of traps field blank, the traps will be generated infinitely.
Time Interval : You can also specify the time interval between the traps that are to be sent. The time interval option is available in minutes, seconds and milliseconds. Eg: 1000 Milliseconds. It is optional.
Click Ok to add the threshold based trap.
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 :
Timer Details:
Staring Time : Configure the date and time at which the simulator will start sending traps.
Periodically send : Check this option,
to send timer traps on a periodical basis. Specify the duration as once
in number of hour(s)/day(s).
Example : You have configured Total Traps as 10 with a timer interval
of 2 seconds and choose to periodically send it once in every 5 days.
This configuration will generate 10 traps with a time interval of 2 secondsonce
in every 5 days.
Total Traps : Specify the total number of trap that you want to send. Eg: 100.
Time Interval : You can also specify the time interval between the traps that are to be sent. The time interval option is available in Minutes, seconds and Milliseconds. Eg: 1000 Milliseconds.
Click Ok to add the timer based trap.
|
|
Note:
|
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,
Click Configure button in the Trap Configuration wizard. The VarBinds dialog pops up with the MIB tree displayed on the right-side.
Select a varbind (only leaf nodes) in the MIB tree and click Add. The Configure VarBinds dialog pops up displaying the OID and instance of the selected varbind .
You can specify the varbind value with any one of the following options :
Agent Value : Agent value refers to the value of the node configured in the simulated agent. You can also configure to send traps with updated agent values.
Agent Macro : The following agent macros are supported:
SysUpTime: Selecting this macro will return the sysUpTime value of the agent as the varbind value.
CurrentTime: Selecting this macro will return the current time as the varbind value.
Custom Value : If custom value is selected, the value must be specified in the appropriate format based on the selected node.
Click OK to add the varbind(s).
To modify Varbinds,
Select the added varbind and click Modify.
Make the necessary changes in the Configure Varbinds dialog.
Click OK to add the varbind with modified values.
To Delete Varbinds
Select the varbind from the list and click Delete to remove the varbind.
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.
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,
Select Settings -> Trap Settings option in the menu bar. The Trap Settings dialog pops up.
Specify the Agent Address .The default agent IP address is "localhost". If the specified address is not available in the network, traps will be sent with the default address.
Click OK button.
|
|
Note: The default "from IP Address" is "localhost". If the specified address is not available, traps will be sent with the default address. |
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,
Select Settings -> Trap Settings option in the menu bar. The Trap Settings dialog pops up.
Configure the Manager details like manager name, port and community, by selecting the Add button.
Click OK button, to add the entry to the list.
You can also delete a manager entry, by selecting the Delete button.
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.
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
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 . |
You can modify an existing trap to change the configured values.
Choose the Configure
--> Traps from the menu bar or click on the Trap icon
in the tool bar. The Trap Configurations dialog is brought
up, displaying the traps configured.
Select the trap that you want to modify and Click Modify. The Configure Trap dialog opens up.
Make the required modifications and click OK.
You can delete existing traps from the Trap Configuration table.
Choose the Configure
--> Traps from the menu bar or click on the Trap icon
in the tool bar. The Trap Configurations dialog is brought
up, displaying the traps configured.
Select the trap that you want to delete and Click Delete. The selected traps will be deleted.
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,
Choose Operations --> Generate Traps from the Menu bar.
The Default Traps Dialog opens up. The tree on the left displays all the MIB nodes along with the Traps and Notification nodes.
When you select the defined Trap node, the following information is displayed on the right-side screen:
Trap Name : The name of the default trap will be displayed.
Varbinds : The varbinds associated with the default traps will be displayed.
Description : The Trap description as it appears in the MIB.
Manager Details : You
can specify the manager details, where the trap should be sent. You can
specify the following details like Manager Name, Manager Port, Manager
Community .
Example :
Manager Name : 192.168.215.1 or manager-simtest
Manager Community : public
You can also specify Total traps you want to send with a specified Timer interval. Example : When you specify the Total Traps as 25 and Time Interval as 2000 milliseconds, then 25 traps will be sent with a time interval of 2 seconds between each trap.
Start the Agent at the specified port.
Click Send to send the default 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
Click on the Trap Viewer icon on the toolbar (or)
Choose Configure --> Trap Viewer menu item from the menu bar.
|