11-27-2013 07:02 PM - edited 03-07-2019 04:49 PM
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,
11-27-2013 10:33 PM
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
11-28-2013 12:10 AM
Hi Daniel,
I did not create file manually, EEM script should create file cpuinfo.txt into flash.
Regards
11-28-2013 12:39 AM
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
11-28-2013 09:33 AM
I would agree with Daniel. I don't think you can append to a file that does not exist.
11-28-2013 01:38 PM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide