Consolidated Platform Configuration Guide, Cisco Ios Release 15.2(4)E (Catalyst 2960-X Switches - Cisco Catalyst 2960 series Configuration Manual

Consolidated platform configuration guide, ios release 15.2(4)e
Hide thumbs Also See for Catalyst 2960 series:
Table of Contents

Advertisement

Configuration Examples for Writing Embedded Event Manager Policies Using Tcl
###
### _syslog_pattern (mandatory)
###
###
### Example: _syslog_pattern
###
### _email_server (mandatory)
###
### Example: _email_server
###
### _email_from (mandatory)
### Example: _email_from
###
### _email_to (mandatory)
### Example: _email_to
###
### _email_cc (optional)
###
### Example: _email_cc
###
### _config_cmd1 (optional)
###
### Example: _config_cmd1
###
### _config_cmd2 (optional)
###
### Example: _config_cmd2
###
# check if all the env variables we need exist
# If any of them doesn't exist, print out an error msg and quit
if {![info exists _email_server]} {
set result \
error $result $errorInfo
}
if {![info exists _email_from]} {
set result \
error $result $errorInfo
}
if {![info exists _email_to]} {
set result \
error $result $errorInfo
}
if {![info exists _email_cc]} {
#_email_cc is an option, must set to empty string if not set.
set _email_cc ""
}
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
# 1. query the information of latest triggered eem event
array set arr_einfo [event_reqinfo]
if {$_cerrno != 0} {
set result [format "component=%s; subsys err=%s; posix err=%s;\n%s" \
error $result
}
set msg $arr_einfo(msg)
set config_cmds ""
# 2. execute the user-defined config commands
if [catch {cli_open} result] {
error $result $errorInfo
} else {
array set cli1 $result
}
if [catch {cli_exec $cli1(fd) "en"} result] {

Consolidated Platform Configuration Guide, Cisco IOS Release 15.2(4)E (Catalyst 2960-X Switches)

1818
"Policy cannot be run: variable _email_server has not been set"
"Policy cannot be run: variable _email_from has not been set"
"Policy cannot be run: variable _email_to has not been set"
$_cerr_sub_num $_cerr_sub_err $_cerr_posix_err $_cerr_str]
- A regular expression pattern match string
that is used to compare syslog messages
to determine when policy runs
.*UPDOWN.*FastEthernet0/0.*
- A Simple Mail Transfer Protocol (SMTP)
mail server used to send e-mail.
mailserver.example.com
- The address from which e-mail is sent.
devtest@example.com
- The address to which e-mail is sent.
engineering@example.com
- The address to which the e-mail must
be copied.
manager@example.com
- The first configuration command that
is executed.
interface Ethernet1/0
- The second configuration command that
is executed.
no shutdown

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents