Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

EEM Script for high CPU

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
Silver

EEM Script for high CPU

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 Please rate helpful posts.
New Member

EEM Script for high CPU

Hi Daniel,

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

Regards

Silver

EEM Script for high CPU

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 Please rate helpful posts.
Bronze

EEM Script for high CPU

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

New Member

EEM Script for high CPU

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

189
Views
0
Helpful
5
Replies
CreatePlease login to create content