Cisco ASR 9000 Serie Configuration Manuals page 95

Aggregation services router system
Table of Contents

Advertisement

Configuring and Managing Embedded Event Manager Policies
Command or Action
Step 4
Copy the Tcl package files from Step 1 and the
pkgIndex file from Step 3 to the directory used for
storing user library files on the target router.
Step 5
Copy a user-defined EEM policy file written in Tcl
to the directory used for storing user-defined EEM
policies on the target router.
Step 6
configure
Step 7
event manager directory user library path
Example:
RP/0/RSP0/CPU0:router(config)# event manager
directory user library disk2:/eem_library
Cisco ASR 9000 Series Aggregation Services Router System Monitoring Configuration Guide, Release 4.2.x
How to Write Embedded Event Manager Policies Using Tcl
Purpose
The following example pkgIndex is created when some Tcl package
files are in a library file directory and the pkg_mkindex command
is run:
pkgIndex
# Tcl package index file, version 1.1
# This file is generated by the "pkg_mkIndex" command
# and sourced either when an application starts up or
# by a "package unknown" script. It invokes the
# "package ifneeded" command to set up package-related
# information so that packages will be loaded
automatically
# in response to "package require" commands. When this
# script is sourced, the variable $dir must contain the
# full path name of this file's directory.
package ifneeded xmlrpc 0.3 [list source [file join $dir
xmlrpc.tcl]]
The directory can be the same directory used in
79.
The following example user-defined EEM policy can be used to
test the Tcl library support in EEM:
packagetest.tcl
::cisco::eem::event_register_none maxrun 1000000.000
#
# test if xmlrpc available
#
#
# Namespace imports
#
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
#
package require xmlrpc
puts "Did you get an error?"
Specifies the EEM user library directory; this is the directory to
which the files in
Step 4, on page
Step 4, on page
79were copied.
79

Advertisement

Table of Contents
loading

Table of Contents