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
###
###
###
###
###
###
###
###
###
###
###
###
###
###
###
###
# 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 _perf_iterations]} {
set result \
error $result $errorInfo
}
# ensure our target iteration count > 0
if {$_perf_iterations <= 0} {
set result \
error $result $errorInfo
}
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
# query the event info
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 iter $arr_einfo(data1)
set iter [expr $iter + 1]
# if _perf_cmd1 is defined
if {[info exists _perf_cmd1]} {
# open the cli library
if [catch {cli_open} result] {
} else {
}
# execute the comamnd defined in _perf_cmd1
if [catch {cli_exec $cli1(fd) $_perf_cmd1} result] {
}
# if _perf_cmd2 is defined
if {[info exists _perf_cmd2]} {
}
# if _perf_cmd3 is defined
if {[info exists _perf_cmd3]} {
}
# close the cli library
if [catch {cli_close $cli1(fd) $cli1(tty_id)} result] {

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

1814
Oct 16 19:32:02.772: %HA_EM-6-LOG:
eem_policy/no_perf_test_init.tcl: EEM performance test start
Oct 16 19:32:03.115: %HA_EM-6-LOG:
eem_policy/ap_perf_test_base_cpu.tcl: EEM performance test iteration 1
Oct 16 19:32:03.467: %HA_EM-6-LOG:
eem_policy/ap_perf_test_base_cpu.tcl: EEM performance test iteration 2
...
Oct 16 19:32:36.936: %HA_EM-6-LOG:
eem_policy/ap_perf_test_base_cpu.tcl: EEM performance test iteration 100
Oct 16 19:32:36.936: %HA_EM-6-LOG:
eem_policy/ap_perf_test_base_cpu.tcl: EEM performance test end
The user must calculate execution time and average time of execution.
In this example, total time = 19:32:36.936 - 19:32:02.772 = 34.164
Average script execution time = 341.64 milliseconds
"Policy cannot be run: variable _perf_iterations has not been set"
"Policy cannot be run: variable _perf_iterations <= 0"
$_cerr_sub_num $_cerr_sub_err $_cerr_posix_err $_cerr_str]
error $result $errorInfo
array set cli1 $result
error $result $errorInfo
# execute the comamnd defined in _perf_cmd2
if [catch {cli_exec $cli1(fd) $_perf_cmd2} result] {
error $result $errorInfo
} else {
set cmd_output $result
}
# execute the comamnd defined in _perf_cmd3
if [catch {cli_exec $cli1(fd) $_perf_cmd3} result] {
error $result $errorInfo
} else {
set cmd_output $result
}
error $result $errorInfo

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents