cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1010
Views
0
Helpful
3
Replies

Not able to register a Simple script to capture high cpu usage

rbunal
Level 1
Level 1

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.

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

You're missing the "period" keyword in your event spec line.  You need to specify a polling period for wdsysmon (e.g., period 60).

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

Depending on your version of code, you may need:

::cisco::eem::event_register_wdsysmon timewin 60 sub1 cpu_tot op ge val 80