EasyManuals Logo

Cisco Catalyst 2960 Series User Manual

Cisco Catalyst 2960 Series
2288 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #1868 background imageLoading...
Page #1868 background image
Tcl Policy Structure and Requirements
All EEM policies share the same structure, shown in the figure below. There are two parts of an EEM policy
that are required: the event_register Tcl command extension and the body. The remaining parts of the policy
are optional: environment must defines, namespace import, entry status, and exit status.
Figure 112: Tcl Policy Structure and Requirements
The start of every policy must describe and register the event to detect using an event_register Tcl command
extension. This part of the policy schedules the running of the policy . The following example Tcl code shows
how to register the event_register_timer Tcl command extension:
::cisco::eem::event_register_timer cron name crontimer2 cron_entry $_cron_entry maxrun 240
The environment must defines section is optional and includes the definition of environment variables. The
following example Tcl code shows how to check for, and define, some environment variables.
# Check if all the env variables that we need exist.
# If any of them does not exist, print out an error msg and quit.
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
The namespace import section is optional and defines code libraries. The following example Tcl code shows
how to configure a namespace import section.
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
The body of the policy is a required structure and might contain the following:
The event_reqinfoevent information Tcl command extension that is used to query the EEM for
information about the detected event.
Consolidated Platform Configuration Guide, Cisco IOS Release 15.2(4)E (Catalyst 2960-X Switches)
1786
How to Write Embedded Event Manager Policies Using Tcl

Table of Contents

Other manuals for Cisco Catalyst 2960 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Cisco Catalyst 2960 Series and is the answer not in the manual?

Cisco Catalyst 2960 Series Specifications

General IconGeneral
LayerLayer 2
Power over Ethernet (PoE)Available on some models
RAM128 MB
Flash Memory32 MB
MAC Address Table Size8000
Operating Temperature0°C to 45°C (32 to 113°F)
Ports24 or 48 x 10/100/1000

Related product manuals