Cisco ASR 9000 Serie Configuration Manuals page 89

Aggregation services router system
Table of Contents

Advertisement

Configuring and Managing Embedded Event Manager Policies
Command or Action
Step 6
Program the body of the script.
Step 7
Check the entry status to determine if
a policy has previously run for this
event.
Step 8
Check the exit status to determine
whether or not to apply the default
action for this event, if a default action
exists.
Step 9
Set Cisco Error Number (_cerrno) Tcl
global variables.
Step 10
Save the Tcl script with a new filename,
and copy the Tcl script to the router.
Purpose
For example, EEM environment variables defined by the sample policies include
e-mail variables. The sample policies that send e-mail must have the following
variables set in order to function properly. The following are the e-mail-specific
environment variables used in the sample EEM policies.
• _email_server—A Simple Mail Transfer Protocol (SMTP) mail server
used to send e-mail (for example, mailserver.example.com)
• _email_to—The address to which e-mail is sent (for example,
engineering@example.com)
• _email_from—The address from which e-mail is sent (for example,
devtest@example.com)
• _email_cc—The address to which the e-mail must be copied (for example,
manager@example.com)
In this section of the script, you can define any of the following:
• The event_reqinfo event information Tcl command extension that is used
to query the EEM for information about the detected event.
• The action Tcl command extensions, such as action_syslog, that are used
to specify actions specific to EEM.
• The system information Tcl command extensions, such as
sys_reqinfo_routername, that are used to obtain general system
information.
• The context_save and context_retrieve Tcl command extensions that are
used to save Tcl variables for use by other policies.
• Use of the SMTP library (to send e-mail notifications) or the CLI library
(to run CLI commands) from a policy.
If the prior policy is successful, the current policy may or may not require
execution. Entry status designations may use one of three possible values: 0
(previous policy was successful), Not=0 (previous policy failed), and Undefined
(no previous policy was executed).
A value of zero means that the default action should not be performed. A value
of nonzero means that the default action should be performed. The exit status is
passed to subsequent policies that are run for the same event.
Some EEM Tcl command extensions set a Cisco Error Number Tcl global variable
_cerrno. Whenever _cerrno is set, four other Tcl global variables are derived
from _cerrno and are set along with it (_cerr_sub_num, _cerr_sub_err,
_cerr_posix_err, and _cerr_str).
Embedded Event Manager policy filenames adhere to the following specification:
Cisco ASR 9000 Series Aggregation Services Router System Monitoring Configuration Guide, Release 4.2.x
How to Write Embedded Event Manager Policies Using Tcl
73

Advertisement

Table of Contents
loading

Table of Contents