|
|
The TrafficDirector application includes a Property Editor for configuring alarms on network variables to determine when a specific condition occurs.
The following sections describe how to configure alarms:
An alarm is predefined condition based on a rising data threshold, a falling data threshold, or both. You configure alarms in shared or custom properties files using the TrafficDirector Property Editor application. You define all alarm parameters in Property Editor using the Add Alarm dialog box.
After you add alarm(s) to properties file(s) and attach the properties file(s) to an agent(s), interface(s), or switch port(s), your TrafficDirector console receives notification for each alarm you defined whenever the parameters for that alarm are met or exceeded in the network.
When you configure an alarm, you must specify a rising threshold and a falling threshold.
When a threshold is met or exceeded, the agent sends an SNMP trap (notification message) to the TrafficDirector console. The Alert Monitor icon blinks until you select it. For more information about working with Alert Monitor, see Chapter 10, "Using Alert Monitor."
A network variable is an element that can be monitored by the SwitchProbe device. Some network variables include Drop Events, Utilization, Packets, Broadcast, Multicast, Fragments, Jabbers, and CRC/Align. For more information on choosing which network variables you want to monitor see "Adding Alarms to AgentsUsing Custom or Shared Properties."
The following sections provide more information about alarms:
A trap is a notification message sent by an SNMP agent to a TrafficDirector console to indicate when rising, falling, or both thresholds are met or exceeded.
For more information about traps, see "Understanding Alert Monitor Terms" in Chapter 10, "Using Alert Monitor."
You can rearm a threshold to prevent the agent from sending redundant traps based on small fluctuations. For example, a trap is generated when utilization crosses a threshold of 80 percent, and drops to 79 percent. Depending on the configuration, another trap could be generated seconds later when utilization rises to 81 percent. Sending constant alarms could be redundant and costly in terms of processing.
To prevent multiple alarms, the agent generates an SNMP trap the first time the rising threshold is crossed, and does not generate another trap until the value of the network variable crosses the falling threshold again. Similarly, once the falling threshold is crossed, the agent can generate an SNMP trap, but not generate another trap until the value of the network variable reaches the rising threshold, then crosses the falling threshold again.
When you set rising and falling thresholds, you may want to be notified when only one threshold is reached.
For example, you want the agent to notify you when utilization on a network segment reaches 95 percent, but you want to avoid the redundant traps described in the preceding example. In this case you would configure an alarm on utilization with a rising threshold of 95 percent and a falling threshold of 75 percent. You would configure the agent to generate an SNMP trap only when the rising threshold is reached. The agent generates a trap when segment utilization reaches 95 percent, and does not generate another trap until utilization drops to at least 75 percent, then reaches 95 percent again.
You can configure an alarm to monitor the absolute or the delta value of a network variable.
In most cases, whether you monitor the absolute or delta value of a network variable depends on the type of variable you are working with. You can set alarms on the following types of network variables:
The following sections provide more information:
Because counters increment but do not decrement, it is better to sample the counter as a delta value, where you are concerned with the rate of change in a given time interval. A counter sampled as an absolute value can never cross a falling threshold and can cross a rising threshold only once.
For example, based on your network utilization, you have determined that 280 collisions could flag a possible problem. Because collisions is a counter that increases but does not decrease in value, it would not be a good idea to set a rising threshold of 280 and sample the collisions variable as an absolute value. If you did, only a single trap would be sent when the number of collisions reached 280 (even if it took several hours to reach 280), but would never be sent again.
It would be more meaningful to monitor the value of the collisions variable as a delta value, to alert you if there is a large number of collisions over a given time period. Specifying the interval at which you want the SwitchProbe device to sample the network variable is very important when you use delta values.
For example, you may want the agent to notify you if the number of errors on the segment has increased by more than 280 in a minute. To do this, you could configure an alarm on CRC/Align Errors with:
You would configure the agent to generate a trap only when the rising threshold is crossed. The SwitchProbe device or Network Analysis Module samples the variable containing the number of CRC/align errors every 60 seconds, and subtracts the value of the network variable during the last sample period from the current value. If the difference between the two values reaches or exceeds 280, the agent would generate an SNMP trap and notifies you of the situation.
It might be beneficial to occasionally sample a counter as an absolute value. For example, you want an agent to notify you when the number of nodes on a Token Ring segment reaches 100. In this case, you would configure an alarm on the TR Ring Station variable (Active Stations) with:
You would configure the agent to generate a trap when the rising threshold is crossed. The SwitchProbe device or Network Analysis Module periodically samples the variable containing the number of active stations and compares that value to the rising threshold of 100. If the number of Active Stations reaches or exceeds 100 during any sampling period, the agent generates an SNMP trap.
When monitoring gauge variables, you are usually concerned when an upper limit is reached. You may want the agent to generate a trap when a rising threshold is crossed, and define the falling threshold to reasonably rearm the rising threshold after it is crossed. You monitor gauges as absolute values.
For example, when a device takes an unusually long time to respond to a Round Trip Delay (IP ping), that may indicate that the device may be overloaded or there is congestion in the path to the device. You may want the agent to notify you when the device takes 1.5 seconds or longer to respond. To do so, you would configure an alarm on Average Response Time with:
You would configure the agent to generate a trap when the rising threshold is reached. Set the falling threshold to 500 milliseconds to rearm the rising threshold after it is crossed.
The SwitchProbe device or Network Analysis Module periodically samples the variable containing the average response time and compares that value to the rising threshold of 1500 milliseconds. If the value of Average Response Time reaches or exceeds 1.5 seconds during any sampling period, the agent generates a trap, and does not generate another one until the value of average response time drops to at least 500 milliseconds, then rises back up to 1500 milliseconds.
When you add or modify an alarm, you can define trap messages for the rising and falling thresholds. The message includes the following items:
Defining trap descriptions are useful when working with DLCIs, switch ports, and multiport SwitchProbe devices, because there is no built-in mechanism for determining which DLCI, switch port, or interface originated the trap. You can define the message to let you know which DLCI, switch port, or SwitchProbe interface generated the trap.
For example, if you configure alarms on two DLCIs to notify you when utilization reaches 75 percent, you can enter the following descriptions as part of the alarm configuration for each DLCI:
Utilization reached 75% on DLCI #1 and Utilization reached 75% on DLCI #2
Doing this can help you determine which DLCI originated the trap.
You can also configure the severity rating to identify the DLCI or port number which originated the trap, then write a script to take specific action based on the severity level. The script action will be based on the DLCI or port on which the alarm is triggered.
For example, if you configure an alarm on DLCI number 80, you can specify the severity level as 80. Similarly, if you configure an alarm on port 16, you can specify the severity level as 16. This information is then passed to the script you specify as the script to run.
You can configure the agent to generate one of seven predefined SNMP trap types, as listed in Table 9-1:
| This Trap Type... | Indicates That... |
|---|---|
coldStart(0) | The sending protocol entity is reinitializing itself; as a result, the agent's configuration or the protocol entity implementation may be altered. |
warmStart(1) | The sending protocol entity is reinitializing itself; as a result, neither the agent configuration nor the protocol entity implementation is altered. |
linkDown(2) | The sending protocol entity recognizes a failure in one of the communication links represented in the agent's configuration. |
linkUp(3) | The sending protocol entity recognizes that one of the communication links represented in the agent's configuration has come up. |
authenticationFailure(4) | The sending protocol entity is the addressee of a protocol message that is not properly authenticated. While implementations of SNMP must be capable of generating this trap, they must also be capable of suppressing the emission of such traps via an implementation- specific mechanism. |
egpNeighborLoss(5) | An EGP neighbor for whom the sending protocol entity was an EGP peer has been marked down. |
enterpriseSpecific(6) | The sending protocol entity recognizes that an enterprise-specific event has occurred. The specific-trap field identifies the particular trap that occurred. |
To configure the agent to generate one of seven pre-defined SNMP trap types, follow these steps:
Step 1 Click the Property Editor icon.
Step 2 Do one of the following:
Step 3 Open the agent properties file that you want to use to define an alarm.
The Property Editor window opens.
Step 4 Click Add (to the right of the alarm list box in the lower half of the Property Editor window).
The Add Trap dialog box is displayed.
Step 5 Specify a number in the ID field that corresponds to the trap type you want the agent to generate.
Step 6 Click OK to add and save the alarm to the properties file.
You configure alarms in shared or custom properties files using Property Editor. You define all alarm parameters in Property Editor using the Add Trap dialog box.
You can configure alarms for different type of devices, and you can configure alarms against: agents, virtual interfaces (VLANs, VCs, and DLCIs), and switch ports.
Table 9-2 shows the type of properties file you use to define different types of alarms:
| To configure alarms on... | Use This Type of Property File |
|---|---|
Domains installed on agents | Shared or custom |
VLANs, VCs, or DLCIs | Custom |
Switch ports | Port |
For more information about creating and editing properties files, see "Working with Properties."
The following sections contain more information about defining alarms in properties files:
The Add Trap Dialog box fields and buttons are described in Table 9-3:
| Field or Button | Description |
|---|---|
Domain | Domain on which you want to configure the alarm. Select the box to the right of the Domain field, then select a domain from the Domain list box. |
Stats/MIB Type | The statistics group that contains the variable on which you want to configure the alarm. |
Variable | Select the variable on which you want to set the alarm. |
*Key/DLCI/ | The DLCI, VLAN, or virtual channel on which you want to configure the alarm. You can select this field only when you are configuring custom properties files for Frame Relay, VLAN, or FC interface.
|
Key 1 | If you select Domain as the Stats Type, enter the host address (when monitoring host stats) or the source IP address (when monitoring conversation statistics). If you selected User Defined as the Stats Type, specify an entry you want appended to the OID string. This entry applies to those times when a Rising Threshold is met or crossed. |
Key 2 | If you select Domain as the Stats Type, enter the destination address (when monitoring conversation statistics). If you selected User Defined as the Stats Type, specify an entry you want appended to the OID string. This entry applies to those times when a Falling Threshold is met or crossed. |
Trap Type Value | Determines whether the alarm is triggered on a change in data rate (delta), such as packets per second; or an absolute value (absolute), such as number of packets counted or utilization. The default is absolute. |
Trap Type | If you select Rising, traps are not sent when falling thresholds are crossed. If you select Falling, traps are not sent when rising thresholds are crossed. The default is Both. |
Threshold | The rising and falling threshold value that triggers the trap. Values must be a decimal number. The ranges allowed depend on the variable selected. Note If you are entering a value for utilization, you enter the percentage value as decimal number. For example, to specify a threshold of 80 percent utilization, enter 80. |
Severity | A decimal value that represents the relative rating of severity of the trap, from 0 to 99l. The severity rating of a trap appears as part of the trap message sent by the agent. If you selected rising or falling, specify a severity level for rising, falling, or both. If you select Both, specify a severity level for both rising and falling. |
Script | The name of script of batch file you want to execute when trap is detected. The default directory is $NSHOME/scripts. You can use a trap to generate actions in the TrafficDirector application, UNIX, or DOS. If you selected Rising or Falling, specify a script or a batch file for rising, falling, or both. |
Description | A text string that you want sent as part of the trap message when the threshold is exceeded. If you selected rising or falling, specify a description for rising, falling, or both. If you select both, specify a description for both rising and falling. |
Community | The agent sends traps to each host registered for the community specified when a rising and falling threshold is reached. The host from which you installed the alarm is automatically registered in the specified rising and falling communities. If you selected Rising of Falling, specify a community for rising, falling, or both. If you selected Both, specify a community for both rising and falling. The default community for both is public. |
Trap Number | A number you define to identify the trap as either rising or falling. If you selected Rising or Falling, specify a trap number for rising, falling, or both. If you selected Both, specify a trap number for both rising and falling. The default rising trap number is 1; the default falling trap number is 2. |
Check Every Field | The interval, in seconds, at which the agent samples the data and compares it with applicable rising and falling thresholds. The value must be a decimal number. The valid range is 1 to 1000. |
ID | The type of SNMP trap to sent. This is a standard SNMP 0 to 6 trap type number. The default is 6. |
Figure 9-1 shows the Add Trap window:
When you click Add (to the right of the alarm list box in the lower half of the Property Editor window), the Add Trap dialog box opens.
You can assign an alarm to an agent by using either a custom or shared properties file which you create and edit using the TrafficDirector Property Editor application.
To add an alarm to a custom or shared properties file, follow these steps:
Step 1 Click the Property Editor icon.
Step 2 Open the agent properties file that you want to use to define an alarm.
The Property Editor window opens.
Step 3 Click Add (to the right of the alarm list box in the lower half of the Property Editor window).
The Add Trap dialog box opens.
Step 4 Click the Domain window button.
Step 5 Select the domain type.
Step 6 Click the Stats Type window button and select:
Step 7 Click the Variable window button.
Step 8 Select a network variable.
Step 9 If you selected Domain or User Defined in Step 6, do one of the following:
Step 10 If you selected Domain or User Defined in Step 6, do one of the following:
Step 11 At the Type radio buttons, follow these steps:
(a) Select one of the following trap value types:
Delta---An alarm is triggered by a change in the data rate, such as packets per second.
Absolute---An alarm is triggered by an absolute value that is reached, such as the number of packets counted, or utilization reached.
(b) Select the type of trap you want to generate:
Rising Threshold---Traps are generated only when rising threshold is crossed.
Falling Threshold---Traps are generated only when falling threshold is crossed.
Both.
Step 12 In the Rising and Falling Threshold text box, enter a decimal number for the thresholds you want to set (rising, falling, or both).
Step 13 For utilization, enter a percentage value, such as 95 for 95%.
Step 14 In the Rising and Falling Severity text box, enter the trap's relative severity rating from 0 to 99 for all of the thresholds you want to set (rising, falling or both).
Step 15 In the Script text box, enter the name of the script or batch file that you want the TrafficDirector application to execute when the trap is received.
Step 16 In the Description text box, enter the text string that you want sent as part of the trap message.
Specify up to 30 characters for rising, falling, or both thresholds.
Step 17 In the Community text box, enter the name of the community string that you want to be notified when the trap occurs.
A trap message will be sent to every host registered for the community you specify.
Step 18 Specify the community to receive messages when rising, falling, or both thresholds are crossed.
Step 19 In the Trap Number text box, specify a trap number for rising, falling, or both thresholds.
Step 20 In the ID text box, enter a number from 0-6 to indicate the type of SNMP trap to send.
For more information about SNMP trap types, see "Identifying Predefined Trap Types."
Step 21 In the Check every text box, enter the interval from 1 to 1000 seconds that you want the agent to check to verify the thresholds specified.
Step 22 Click OK to add this alarm definition to the properties file.
Step 23 Close the Property Editor Window.
Step 24 Start Configuration Manager.
Step 25 Verify the following settings.
(Figure 9-2 shows the location of each area in the window).
Step 26 Click Install to install the properties file on the agent.
Step 27 Select an install option from the Properties File Installation dialog box (Figure 9-3).
Step 28 Click OK.
Step 29 Verify that the properties file has been installed by checking the message in the status bar. The message should read, "Installed shared/custom properties file onto Agent: Name."
You can assign alarms to virtual interfaces (VCs, VLANs, or DLCIs) using a custom properties file that you create using the TrafficDirector Property Editor application.
Within Property Editor, you use the Add Trap dialog box to define an alarm.
To assign an alarm to a custom properties file, follow these steps:
Step 1 Open Configuration Manager and do the following:
(a) Select one of the following types of agents:
VC Agent
VLAN Agent
DLCI Agent
(b) Click the Custom radio button to create a Custom Properties file.
(c) Click Properties to open the Custom Properties file.
Step 2 Click Add (to the right of the alarm list box in the lower half of the Property Editor window).
The Add Trap dialog box opens (Figure 9-1).
Step 3 In the Add Trap dialog box, click the Domain window button.
Step 4 Select the domain type.
Step 5 Click the Interface window button (DLCI, VLAN, VC) to display the Interface dialog box.
Step 6 In the Interface dialog box, select the interface you want.
Step 7 Click the Stats/MIB Type window button.
Step 8 Select a stat type from the Select Stats Type dialog box.
Step 9 Click the Variable window button.
Step 10 If you chose Domain or User Defined in Step 3, do one of the following:
Step 11 If you chose Domain or User Defined in Step 3, do one of the following:
Step 12 Select a network variable from the Select Variable dialog box.
Step 13 Use the Type radio buttons to perform the following steps:
(a) Select one of the following trap value types:
Delta---Alarm is triggered by a change in the data rate, such as packets per second.
Absolute---Alarm is triggered by an absolute value that is reached, such as the number of packets counted, or utilization reached.
(b) Select the type of trap you want to generate:
Rising Threshold---Traps are generated only when rising threshold is crossed.
Falling Threshold---Traps are generated only when falling threshold is crossed.
Both.
Step 14 In the Rising and Falling Threshold text box, enter a decimal number for the thresholds you want to set (rising, falling, or both).
Step 15 For utilization, enter a percentage value, such as 95 for 95 percent.
Step 16 In the Rising and Falling Severity text box, enter the trap's relative severity rating from 0 to 99 for all of the thresholds you want to set (rising, falling or both).
Step 17 In the Script text box, enter the name of the script or batch file that you want the TrafficDirector application to execute when the trap is received.
Step 18 In the Description text box, enter the text string that you want to be sent as part of the trap message.
Specify up to 30 characters for rising, falling, or both thresholds.
Step 19 In the Community text box, enter the name of the community string that you want to be notified when the trap occurs.
A trap message will be sent to every host registered for the community you specify.
Step 20 Specify the community to receive messages when rising, falling, or both thresholds are crossed.
Step 21 In the Trap Number text box, specify a trap number for rising, falling, or both thresholds.
Step 22 In the ID text box, type a number from 0 to 6 to indicate the type of SNMP trap to send.
For more information about SNMP trap types, see "Identifying Predefined Trap Types."
Step 23 In the Check every text box, enter the interval from 1 to 1000 seconds that you want the agent to check to verify the thresholds specified.
Step 24 Click OK to add this alarm definition to the properties file.
Step 25 Open Configuration Manager.
Step 26 Click Install to install the properties file on the agent.
Step 27 Click OK to install the properties file on the DLCI, VLAN, or VC agent.
You use Property Editor to add an alarm to a switch properties file. After you add an alarm to a switch properties file, all ports using that properties file will be affected by this alarm.
You can add alarms to a new port properties file or to an existing port properties file.
To add an alarm to a switch port properties file, follow these steps:
Step 1 Click the Property Editor icon.
Step 2 Do one of the following:
The Property Editor window opens.
Step 3 Click the Add button (to the right of the alarm list box in the lower half of the Property Editor window).
The Add Trap dialog box opens (Figure 9-1).
Step 4 In the Add Trap dialog box, click the Domain window button and select:
Step 5 Click the Stats/MIB window button to select a stat type.
Step 6 Click the Variable window button.
Step 7 Select a network variable.
Step 8 If you selected Domain or User Defined in Step 3, do one of the following:
Step 9 If you selected Domain or User Defined in Step 3, do one of the following:
Step 10 Use the Type radio buttons to perform the following steps:
(a) Select one of the following trap value types:
Delta---An alarm is triggered by a change in the data rate, such as packets per second.
Absolute---An alarm is triggered by an absolute value that is reached, such as the number of packets counted, or utilization reached.
(b) Select the type of trap you want to generate:
Rising Threshold---Traps are generated only when rising threshold is crossed.
Falling Threshold---Traps are generated only when falling threshold is crossed.
Both---Traps are generated when either the rising and falling thresholds are crossed.
Step 11 In the Rising and Falling Threshold text box, enter a decimal number for the thresholds you want to set (rising, falling, or both).
For utilization, enter a percentage value, such as 95 for 95 percent.
Step 12 In the Rising and Falling Severity text box, enter the trap's relative severity rating from 0 to 99 for all of the thresholds you want to set (rising, falling or both).
Step 13 In the Script text box, type the name of the script or batch file that you want the TrafficDirector application to execute when the trap is received.
Step 14 In the Description text box, enter the text string that you want to be sent as part of the trap message.
Specify up to 30 characters for rising, falling, or both thresholds.
Step 15 In the Community text box, enter the name of the community string that you want to be notified when the trap occurs.
A trap message will be sent to every host registered for the community you specify.
Step 16 Specify the community to receive messages when rising, falling, or both thresholds are crossed.
Step 17 In the Trap Number text box, a trap number for rising, falling, or both thresholds.
Step 18 In the ID text box, enter a number from 0-6 to indicate the type of SNMP trap to send. For more information about SNMP trap types, see "Identifying Predefined Trap Types."
Step 19 In the Check every text box, enter the interval from 1-1000 seconds that you want the agent to check to verify the thresholds specified.
Step 20 Click OK to add this alarm definition to the properties file.
Step 21 Open Configuration Manager.
Step 22 Click Install to install the properties file on the agent.
Step 23 Click OK to install the properties file on the switch port.
You can use the TrafficDirector application to set TRAPs on non-RMON MIB objects (for example, a non-RMON object would be ifOutoctets, which is the number of bytes within a packet transmitted out of a router or switch port).
To set a TRAP on a non-RMON OID, follow these steps:
Step 1 Edit the file $NSHOME/usr/usrtrap.oid to include the non-RMON OID MIB.
Step 2 Start Configuration Manager.
Step 3 Select the switch.
Step 4 Click Custom.
Step 5 Click Property.
Step 6 In the bottom half of the window, click Add.
Step 7 In the Stats Type field, select User Defined.
Step 8 Select the non-RMON OID from the trap variable field.
Step 9 Click OK.
Step 10 Click Install.
An alternate way to do this is to add the MIB to the $NSHOME/usr directory in the same format as the other *.mib files. You can then use the Proxy SNMP feature to configure the TRAP.
To delete any alarms you no longer need, follow these steps:
Step 1 Open Property Editor.
Step 2 Select the properties file you want to edit.
Step 3 Select the trap you want to delete from the lower list box in the Property Editor main window.
Step 4 Click Delete.
A dialog box opens to confirm the deletion.
Step 5 Click Yes to delete the trap, or click No to cancel the delete request.
You can use Property Editor to modify any existing alarm parameters. To do this, you use the Edit Trap dialog box to change the existing threshold values, destination address, or the script or batch file to execute when the trap occurs.
To edit parameters on the Edit Trap dialog box, follow these steps:
Step 1 Open Property Editor.
Step 2 Select the properties file you want to edit.
Step 3 Select the trap you want to edit from the lower list box in the Property Editor dialog box.
Step 4 Click Edit.
The Edit Trap window (Figure 9-4) opens with the existing alarm parameters.
Step 5 Make the necessary changes.
For more information about the files on this screen and their associated values, see "Defining Alarms in Properties Files."
Step 6 Click OK to accept the changes, or click Cancel to leave the configuration unchanged.
You can define the IP addresses where you want the agent to send SNMP trap notification messages when alarm conditions occur by using either the Set Trap Destinations icon on the TrafficDirector main window, or the dvadmin command-line utility.
To send alerts to other TrafficDirector consoles, you must add the IP addresses of the other hosts to the trap destination table in the SwitchProbe device.
If you delete a host directly from the Set Trap Destination window, doing so will not remove the host from the trap destination table. You must use the dvadmin command-line utility to delete a host-community mapping from the trap-destination table within a specified agent. For more information, see "Using dvadmin to Cancel Alerts to Other Hosts."
The following sections describe how you use the Set Trap Destinations icon and the dvadmin command-line utility to send alerts to other TrafficDirector hosts:
You must configure hosts with the TrafficDirector application so they can receive SNMP trap messages.
To define the TrafficDirector hosts and IP addresses where you want the agent to send an SNMP trap message when alarm conditions occur, follow these steps.
Step 1 In the TrafficDirector Admin window, click the Set Trap Destinations icon.
The Set Trap Destinations dialog box opens (Figure 9-5):
Step 2 Specify up to four addresses of other TrafficDirector hosts to which you want alert messages sent.
Step 3 Click OK.
The agent is configured to send SNMP traps to host(s) you specified.
You use the dvadmin utility to send alert messages to other TrafficDirector hosts.
To add a host-community mapping to the trap destination table within a specified agent, use the following command syntax:
dvadmin agent add target_host trap_community
where:
To delete a host-community mapping from the trap-destination table within a specified agent, use the following command syntax:
dvadmin agent delete target_host trap_community
where:
You can view the contents of the trap destination table within a specified agent to see which to which hosts the SwitchProbe device will send traps.
To view the contents of the trap destination table use the following command syntax:
dvadmin agent list
where agent is the agent that contains the trap-destination table you want to view.
You can create your own UNIX script files, DOS BAT files, or executables to take a specific action when a trap occurs. To do so, you define the name and path of the file as the script or DOS batch file to run when you add the alarm.
The TrafficDirector application provide three sample batch files to get you started. For more information about using these batch files, see "Using Sample Batch Files."
When an alarm occurs, you can execute scripts for UNIX, and batch files for PCs to perform functions such as opening a console window to display data, sending mail messages, or printing alarm information. You can also set up scripts and batch files to perform network actions, such as changing the speed of a router.
For example, you may want to automatically change the speed of a WAN router if utilization reaches a certain threshold. You can write a script to change the router speed if an alarm based on utilization is triggered. You can also generate and display data for a network segment by writing a script file that runs and displays the data in a separate console window when a certain threshold is reached. You can also specify an audible alarm and have an onscreen message flash if a severity 1 trap occurs. A script file sends an e-mail message when a trap is received
The following sections describe how to alerts can be used to run UNIX script and DOS batch files:
To get you started, the TrafficDirector application is shipped with three sample batch files in the $NSHOME/Scripts directory:
The snaphost.bat file spawns a separate console window to display a 30-second snapshot of host data for the IP Domain on agent et101.
Figure 9-6 shows an example of snaphost.bat. The spawn command (located in the batch file) opens a separate console window to display the host data.
See Appendix E, "Using Command-Line Utilities" for more information about the spawn utility.
To activate the display console, you must configure the snaphost.bat file to run. For more information about adding batch files and scripts, see "Defining Alarms in Properties Files."
The display console window opens (Figure 9-7), containing a 30-second snapshot of host data for the IP Domain on agent et101.
You can create your own UNIX script files to take a specific action when a trap occurs. You define the name of the file as the script to run when you add the alarm. This example shows you a sample shell script in which an e-mail message is sent to a user, showing the top hosts and conversations:
# echo High utilization trap received from agent $1, priority $2 > temp.$$ echo Top 10 hosts: >> temp.$$ $NSHOME/bin/dvsnap $1 ALL HOST 30 10 >> temp.$$ echo Top 10 conversations: >> temp.$$ $NSHOME/bin/dvsnap $1 ALL CONV 30 10 >> temp.$$ mail `whoami` < temp.$$ rm temp.$$
The TrafficDirector console running on a Microsoft Windows platform can invoke TrafficDirector applications or batch files when an alarm message is received.
You can use the dvtool command-line utility or TrafficDirector applications such as Data Capture or TopN Hosts to receive more information about the alarm condition.
To run a batch file, use the following DOS command syntax:
dvtool_name arguments >> output.filename
To execute TrafficDirector applications, use the following command syntax:
run path\app_name arguments
where path\app_name is the path and application filename, and arguments are the application arguments, if any.
See Appendix E, "Using Command-Line Utilities" for more information about running TrafficDirector utilities and applications from the command line.
To add a BAT or script file to an TrafficDirector alarm definition, follow these steps:
Step 1 Write and store the batch or script file in the $NSHOME/usr directory.
Step 2 Open the appropriate properties file and add an alarm or edit an existing alarm.
(For more information, see "Defining Alarms in Properties Files.")
Step 3 In the Add Alarm or Edit Alarm dialog box, enter the script or batch file name in the appropriate Script field (the entire path can not exceed fifteen characters).
Step 4 Click OK to add the alarm.
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Posted: Mon Apr 5 13:11:24 PDT 1999
Copyright 1989-1999©Cisco Systems Inc.