04-05-2017 12:38 PM
When attempting to register the TCL script on my ASR 9K I get an error:
event manager policy cpu_80.tcl username admin persist-time 3600 type user
!!% Embedded Event Manager configuration: failed to retrieve intermediate registration result for policy cpu_80.tcl
::cisco::eem::event_register_wdsysmon sub1 cpu_tot op ge val 80
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
if [catch {cli_open} result] {
error $result $errorInfo
} else {
array set cli1 $result
}
cli_exec $cli1(fd) "term len 0"
cli_exec $cli1(fd) "show processes cpu location 0/RSP0/CPU0 | file append disk0a:/usr/cpucap.txt"
cli_exec $cli1(fd) "show processor cpu location 0/RSP1/CPU0 | file append disk0a:/usr/cpucap.txt"
cli_exec $cli1(fd) "show processor cpu location 0/0/CPU0 | file append disk0a:/usr/cpucap.txt"
cli_exec $cli1(fd) "show processor cpu location 0/1/CPU0 | file append disk0a:/usr/cpucap.txt"
catch {cli_close $cli(fd) $cli(tty_id)}
I'm able to register and run it as a manual script fine "::cisco::eem::event_register_none"
Thanks for your help.
04-06-2017 12:39 PM
You're missing the "period" keyword in your event spec line. You need to specify a polling period for wdsysmon (e.g., period 60).
04-06-2017 01:18 PM
Thanks Joe. I added the period 60, but it's still failing on registration.
::cisco::eem::event_register_wdsysmon sub1 cpu_tot op ge val 80 period 60
04-06-2017 01:23 PM
Depending on your version of code, you may need:
::cisco::eem::event_register_wdsysmon timewin 60 sub1 cpu_tot op ge val 80
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide