cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2217
Views
0
Helpful
5
Replies

EEM Script for high CPU

nouman_nabi
Level 1
Level 1

Hi

I am trying to write EEM script to troubleshoot intermittent high CPU utilization on 3750 but below script is not working properly.

Syslog "CPU Utilization is high" is generating but it is not creating file "cpuinfo.txt" into flash.

.

event manager applet capture_cpu_spike

   event snmp oid 1.3.6.1.4.1.9.9.109.1.1.1.1.3 get-type next entry-op gt entry-val "80" exit-time 500 poll-interval 5 maxrun 600

   action 001 syslog msg "CPU Utilization is high"

   action 002 cli command "en"

   action 003 cli command "show proc cpu sort | append flash:cpuinfo.txt"

   action 004 cli command "show proc cpu sort | append flash:cpuinfo.txt"

   action 005 cli command "show stack 236 | append flash:cpuinfo.txt"

   action 009 cli command "show log | append flash:cpuinfo.txt"

   action 010 cli command "show mem stat his | append flash:cpuinfo.txt"

   action 011 cli command "show proc cpu his | append flash:cpuinfo.txt"

   action 012 cli command "show align | append flash:cpuinfo.txt"

Please advise if I am missing anything.

Regards,

5 Replies 5

daniel.dib
Level 7
Level 7

Is the file cpuinfo.txt created? If not, I think you need to create that first. You can try to debug when the script is running with debug event manager.

Daniel Dib
CCIE #37149

Daniel Dib
CCIE #37149
CCDE #20160011

Please rate helpful posts.

Hi Daniel,

I did not create file manually, EEM script should create file cpuinfo.txt into flash.

Regards

But you are trying to append to a file. I think that would assume that the file is created first. I'll try it out tonight on a Catalyst if you don't get any further replies explaining the behavior.

Daniel Dib
CCIE #37149

Daniel Dib
CCIE #37149
CCDE #20160011

Please rate helpful posts.

I would agree with Daniel. I don't think you can append to a file that does not exist.

I have created file cpuinfo.txt into switch flash but still data is not storing into file.

4  -rwx          0  Nov 29 1993 22:24:28 +00:00  cpuinfo.txt

Review Cisco Networking products for a $25 gift card