Basic Configuration Details For All Sample Policies; Using The Sample Policies; Running The Sl_Intf_Down.tcl Sample Policy - Cisco ASR 9000 Serie Configuration Manuals

Aggregation services router system
Table of Contents

Advertisement

Configuring and Managing Embedded Event Manager Policies
may become invalid. To avoid any errors, the policy must be unregistered and then reregistered. The following
variables are affected:
• _cron_entry in the tm_cli_cmd.tcl policy
• _syslog_pattern in the sl_intf_down.tcl policy

Basic Configuration Details for All Sample Policies

To allow e-mail to be sent from the Embedded Event Manager (EEM), the hostname and domain-name
commands must be configured. The EEM environment variables must also be set. After a Cisco IOS XR
Software image has been booted, use the following initial configuration, substituting appropriate values for
your network. The environment variables for the tm_fsys_usage sample policy (see
Variables Used in the tm_fsys_usage.tcl Policy, on page
hostname cpu
domain-name example.com
event manager environment _email_server ms.example.net
event manager environment _email_to username@example.net
event manager environment _email_from engineer@example.net
event manager environment _email_cc projectgroup@example.net
event manager environment _cron_entry 0-59/2 0-23/1 * * 0-7
event manager environment _show_cmd show event manager policy registered
event manager environment _syslog_pattern .*UPDOWN.*FastEthernet0/0
event manager environment _config_cmd1 interface Ethernet1/0
event manager environment _config_cmd2 no shutdown
event manager environment _crash_reporter_debug 1
event manager environment _crash_reporter_url
http://www.example.com/fm/interface_tm.cgi
end

Using the Sample Policies

This section contains these configuration scenarios to demonstrate how to use the four sample Tcl policies:

Running the sl_intf_down.tcl Sample Policy

This sample policy demonstrates the ability to modify the configuration when a syslog message with a specific
pattern is logged. The policy gathers detailed information about the event and uses the CLI library to run the
configuration commands specified in the EEM environment variables _config_cmd1 and, optionally,
_config_cmd2. 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, use 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 policies that are available
to be installed. After you enter the configure command to reach global configuration mode, you can register
the sl_intf_down.tcl policy with EEM using the event manager policy command. Exit from global configuration
mode and enter the show event manager policy registered command again, to verify that the policy has been
registered.
The policy runs when an interface goes down. Enter the show event manager environment command to
display the current environment variable values. Unplug the cable (or configure a shutdown) for the interface
specified in the _syslog_pattern EEM environment variable. The interface goes down, prompting the syslog
daemon to log a syslog message about the interface being down, and the syslog event detector is called.
Cisco ASR 9000 Series Aggregation Services Router System Monitoring Configuration Guide, Release 4.2.x
EEM Event Detector Demo: Example
Table 16: Environment
84) are all optional and are not listed here:
85

Advertisement

Table of Contents
loading

Table of Contents