Table 173: E-mail-Specific Environmental Variables Used by the Sample Policies
ExampleDescriptionEnvironment Variable
The e-mail server name can be in any
one of the following template formats:
•
username:password@host
•
username@host
•
host
A Simple Mail Transfer Protocol
(SMTP) mail server used to send
e-mail.
_email_server
engineering@example.comThe address to which e-mail is sent._email_to
devtest@example.comThe address from which e-mail is sent._email_from
manager@example.comThe address to which the e-mail must
be copied.
_email_cc
The following example of a must define section shows how to program a check for e-mail-specific environment variables.
Example of Must Defines
Example:
if {![info exists _email_server]} {
set result \
"Policy cannot be run: variable _email_server has not been set"
error $result $errorInfo
}
if {![info exists _email_from]} {
set result \
"Policy cannot be run: variable _email_from has not been set"
error $result $errorInfo
}
if {![info exists _email_to]} {
set result \
"Policy cannot be run: variable _email_to has not been set"
error $result $errorInfo
}
if {![info exists _email_cc]} {
set result \
"Policy cannot be run: variable _email_cc has not been set"
error $result $errorInfo
}
Step 7
Program the body of the script.
In this section of the script, you can define any of the following:
•
The event_reqinfoevent 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 EEM specific actions.
•
The system information Tcl command extensions, such as sys_reqinfo_routername, that are used to obtain general
system information.
Consolidated Platform Configuration Guide, Cisco IOS Release 15.2(4)E (Catalyst 2960-X Switches)
1793
How to Write Embedded Event Manager Policies Using Tcl