cc/td/doc/product/rtrmgmt/sw_ntman/cwsimain/cwsi2/cwsiug2
hometocprevnextglossaryfeedbacksearchhelp
PDF

Table of Contents

Using Traps to Execute UNIX Script Files

Using Traps to Execute UNIX Script Files

When an alarm condition occurs, an agent can generate an SNMP trap. The agent sends the trap to the IP addresses associated with the community string you specify. The Alert Monitor icon on the TrafficDirector main window will blink repeatedly until you click it. Click the icon again to open the Alert Monitor window and display the traps received by TrafficDirector.


Note Only UNIX script files are described here. You can execute DOS BAT files in the same manner, although BAT files you specify can contain only commands supported by the TrafficDirector shell.

You can also specify the UNIX script files you want to run when SNMP traps are received. These script files can perform alarm functions, such as sending e-mail messages or printing alarm information. They can also perform network actions, such as changing the speed of a router. You can pass two variables from the trap to your UNIX script file: the agent name, and the severity of the trap.

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 a snapshot of the network segment by writing a script file that runs the dvsnap command line utility when a certain threshold is reached. Finally, 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.

To use traps to execute UNIX script files, take the following steps:

Step 1 Write the UNIX script file. Remember that you can use both the agent name and the severity level (as these are always passed to the program to run) from the trap you want to use to execute the script file. Note that you must make the script file executable (for example, using chmod 755 script_file and store the script in the $NSHOME/usr directory, or include the path when specifying the script in the Program to run field.

Step 2 Create an alarm in Property Editor. See "Adding Alarms" in Chapter 37, "Configuring Alarms."

Step 3 Enter the name and path of the script in the appropriate Program to run field. Note that you can specify two separate scripts; one for a rising threshold and one for a falling threshold.

Step 4 Add the alarm. The information in the Program to run field is sent as part of the SNMP trap each time the corresponding rising or falling alarm condition occurs, and the specified script is executed.

hometocprevnextglossaryfeedbacksearchhelp
Copyright 1989-1997 © Cisco Systems Inc.