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

Unanswered Question
Apr 5th, 2017
User Badges:

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Joe Clarke Thu, 04/06/2017 - 12:39
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

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

rbunal Thu, 04/06/2017 - 13:18
User Badges:

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

Joe Clarke Thu, 04/06/2017 - 13:23
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

Depending on your version of code, you may need:

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

Actions

This Discussion