Running The Tm_Cli_Cmd.tcl Sample Policy; Running The Tm_Crash_Reporter.tcl Sample Policy - Cisco ASR 9000 Serie Configuration Manuals

Aggregation services router system
Table of Contents

Advertisement

EEM Event Detector Demo: Example
The syslog event detector reviews the outstanding event specifications and finds a match for interface status
change. The EEM server is notified, and the server runs the policy that is registered to handle this
event—sl_intf_down.tcl.
enable
show event manager policy registered
show event manager policy available
configure terminal
event manager policy sl_intf_down.tcl
end
show event manager policy registered
show event manager environment

Running the tm_cli_cmd.tcl Sample Policy

This sample policy demonstrates the ability to periodically run a CLI command and to e-mail the results. The
CRON specification "0-59/2 0-23/1 * * 0-7" causes this policy to be run on the second minute of each hour.
The policy gathers detailed information about the event and uses the CLI library to execute the configuration
commands specified in the EEM environment variable _show_cmd. An e-mail message is sent with the results
of the CLI command.
The following sample configuration demonstrates how to use this policy. Starting in EXEC mode, enter the
show event manager policy registered command to verify that no policies are currently registered. The next
command is the show event manager policy available command, which displays the policies that are available
to be installed. After you enter the configure command to reach global configuration mode, you can register
the tm_cli_cmd.tcl policy with EEM using the event manager policy command. Exit from global configuration
mode and enter the show event manager policy registered command to verify that the policy has been
registered.
The timer event detector triggers an event for this case periodically, according to the CRON string set in the
EEM environment variable _cron_entry. The EEM server is notified, and the server runs the policy that is
registered to handle this event—tm_cli_cmd.tcl.
enable
show event manager policy registered
show event manager policy available
configure terminal
event manager policy tm_cli_cmd.tcl
end
show event manager policy registered

Running the tm_crash_reporter.tcl Sample Policy

This sample policy demonstrates the ability to send an HTTP-formatted crash report to a URL location. If the
policy registration is saved in the startup configuration file, the policy is triggered 5 seconds after bootup.
When triggered, the script attempts to find the reload reason. If the reload reason was due to a crash, the policy
searches for the related crashinfo file and sends this information to a URL location specified by the user in
the environment variable _crash_reporter_url. A CGI script, interface_tm.cgi, has been created to receive the
URL from the tm_crash_reporter.tcl policy and save the crash information in a local database on the target
URL machine.
A Perl CGI script, interface_tm.cgi, has been created and is designed to run on a machine that contains an
HTTP server and is accessible by the router that runs the tm_crash_reporter.tcl policy. The interface_tm.cgi
script parses the data passed into it from tm_crash_reporter.tcl and appends the crash information to a text
file, creating a history of all crashes in the system. Additionally, detailed information on each crash is stored
in three files in a crash database directory that is specified by the user. Another Perl CGI script,
crash_report_display.cgi, has been created to display the information stored in the database created by the
Cisco ASR 9000 Series Aggregation Services Router System Monitoring Configuration Guide, Release 4.2.x
86
Configuring and Managing Embedded Event Manager Policies

Advertisement

Table of Contents
loading

Table of Contents