hit counter script

Creating An Eem User Tcl Library Index - 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

How to Write Embedded Event Manager Policies Using Tcl
To view examples of the some of these debugging techniques, see the
Policies Examples, on page

Creating an EEM User Tcl Library Index

Perform this task to create an index file that contains a directory of all the procedures contained in a library
of Tcl files. This task allows you to test library support in EEM Tcl. In this task, a library directory is created
to contain the Tcl library files, the files are copied into the directory, and an index tclIndex) is created that
contains a directory of all the procedures in the library files. If the index is not created, the Tcl procedures
will not be found when an EEM policy is run that references a Tcl procedure.
SUMMARY STEPS
1. On your workstation (UNIX, Linux, PC, or Mac) create a library directory and copy the Tcl library files
into the directory.
2. tclsh
3. auto_mkindex directory_name *.tcl
4. Copy the Tcl library files from
an EEM User Tcl Library Index
5. Copy a user-defined EEM policy file written in Tcl to the directory used for storing user-defined EEM
policies on the target device. The directory can be the same directory used in
Library
6. enable
7. configure terminal
8. event manager directory user library path
9. event manager directory user policy path
10. event manager policy policy-name [type {system | user} [trap ]
11. event manager run policy-name
DETAILED STEPS
Step 1
On your workstation (UNIX, Linux, PC, or Mac) create a library directory and copy the Tcl library files into the directory.
The following example files can be used to create a tclIndex on a workstation running the Tcl shell:
lib1.tcl
Example:
proc test1 {} {
puts "In procedure test1"
}
proc test2 {} {
puts "In procedure test2"
}
Consolidated Platform Configuration Guide, Cisco IOS Release 15.2(4)E (Catalyst 2960-X Switches)
1796
When the set command is entered in a policy, a message is displayed anytime a scalar variable is set,
and this provides a way to debug scalar variables. To view an example of this debugging technique, see
the
Tracing Tcl set Command Operations Example, on page
1819.
Index.
Creating an EEM User Tcl Library Index
to the directory used for storing user library files on the target device.
1821.
Debugging Embedded Event Manager
and the tclIndex file from
Creating an EEM User Tcl
Creating

Advertisement

Table of Contents
loading

Table of Contents