Below is the EEM script I found when looking to troubleshoot high CPU (This is not related to the HULC LED bug). We are consistently run above 80%, and it seems to be periodically with no pattern. In an attempt to catch what is going on I added the EEM script:
event manager scheduler script thread class default number 1
event manager applet High_CPU
event snmp oid 1.3.6.1.4.1.9.9.109.1.1.1.1.3.1 get-type exact entry-op ge entry-val 50 poll-interval 5.0
action 0.0 syslog msg "High CPU DETECTED. Please wait - logging Information to file flash:high_cpu.txt"
action 0.1 cli command "enable"
action 0.2 cli command "show clock | append file flash:high_cpu.txt"
action 1.2 cli command "term length 0"
action 1.3 cli command "show process cpu sorted | append file flash:high_cpu.txt"
action 1.4 cli command "show log | append file flash:high_cpu.txt"
action 1.5 cli command "term length 24"
I did not do exactly as the one found on Cisco's page, did not need a couple commands and changed the val and polling.
Here is what happens.
CPU spikes
EEM starts, outputs to the log the following:
Sep 18 11:38:43.457: %HA_EM-6-LOG: High_CPU: High CPU DETECTED. Please wait - logging Information to flash:high_cpu.txt
Look in the directory for the file:
mcrh12-es-03#dir
Directory of flash:/
2 -rwx 616 Feb 28 1993 19:01:57 -05:00 vlan.dat
3 -rwx 3566 Sep 17 2013 15:30:57 -05:00 private-config.text
4 -rwx 2072 Sep 17 2013 15:30:57 -05:00 multiple-fs
5 -rwx 44456 Sep 17 2013 15:30:57 -05:00 config.text
6 drwx 512 Feb 28 1993 19:12:45 -05:00 c3750e-universalk9-mz.150-2.SE
57671680 bytes total (32539136 bytes free)
mcrh12-es-03#
No file.
What am I missing to get the file created and have the output logged in the txt file so I can review it later?