cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
883
Views
0
Helpful
2
Replies

EEM script not working on cisco 3750

Asim Afzal
Level 1
Level 1

HI,

i have applied below script and i can see the script successfuly exceuted but i cant see the file which should store on the flash.Below is script

event snmp oid 1.3.6.1.4.1.9.2.1.56 get-type next entry-op ge entry-val 60 exit-time 10 poll-interval 1

action 1.1 syslog msg "CPU Utilization is high"

action 1.2 cli command "en"

action 1.3 cli command "show proc cpu sorted | append flash:abc.txt"

action 1.4 cli command "show proc cpu history | append flash:cpu2info.txt"

action 1.5 cli command "show ip inter bri | append flash:cpu3info.txt"

action 1.5 syslog msg "cpu commands verification"

wheni  do show flash i cnat see the files in the flash.

2 Replies 2

Renan Abreu
Cisco Employee
Cisco Employee

Hi Asim,

     Your script is configured to start collecting when CPU reaches 60% did it reach this value since you applied it?

     Can you change it to a lower value such as 5% and check if it works?

What are you trying to achieve there?

You can use the script I use if you want to.

service internal

event manager applet high_cpu

event snmp oid 1.3.6.1.4.1.9.9.109.1.1.1.1.6.1 get-type exact entry-op ge entry-val "85" poll-interval 5 ratelimit 60

action 1.0 syslog msg "CPU Utilization is above 85%"

action 2.0 cli command "enable"

action 2.1 cli command "clear mls qos | append flash:eem_alta_de_CPU.log"

action 2.2 cli command "show clock | append flash:eem_alta_de_CPU.log"

action 2.3 cli command "show proc cpu sor | exc 0.0  | append flash:eem_alta_de_CPU.log"

action 2.4 cli command "show proc cpu his | append flash:eem_alta_de_CPU.log"

action 2.5 cli command "show mls qos ip | append flash:eem_alta_de_CPU.log"

action 2.6 cli command "show policy-map control-plane all | append flash:eem_alta_de_CPU.log"

action 2.7 cli command "show mls qos | append flash:eem_alta_de_CPU.log"

action 2.8 cli command "show mls qos statistics-export info | append flash:eem_alta_de_CPU.log"

action 2.9 cli command "show mls qos protocol | append flash:eem_alta_de_CPU.log"

action 3.0 cli command "show interfaces | append flash:eem_alta_de_CPU.log"

action 3.1 cli command "show interfaces switching | append flash:eem_alta_de_CPU.log"

action 3.2 cli command "show interfaces stat | append flash:eem_alta_de_CPU.log"

action 3.3 cli command "show ip nat transl | append flash:eem_alta_de_CPU.log"

action 4.0 cli command "show align | append flash:eem_alta_de_CPU.log"

action 4.1 cli command "show ver | append flash:eem_alta_de_CPU.log"

action 4.2 cli command "show log | append flash:eem_alta_de_CPU.log"

action 4.3 cli command "show stacks | append flash:eem_alta_de_CPU.log"

action 5.0 cli command "show ip cef summary | append flash:eem_alta_de_CPU.log"

action 5.1 cli command "show cef interface | append flash:eem_alta_de_CPU.log"

action 6.0 cli command "show ip interface | append flash:eem_alta_de_CPU.log"

action 7.0 cli command "show cef not-cef-switched | append flash:eem_alta_de_CPU.log"

action 7.1 cli command "show cef drop | append flash:eem_alta_de_CPU.log"

action 8.0 cli command "show ip cache flow | append flash:eem_alta_de_CPU.log"

action 9.0 cli command "show pxf accounting summary | append flash:eem_alta_de_CPU.log"

action 9.1 cli command "show region | append flash:eem_alta_de_CPU.log"

action 9.2 cli command "show memory statistics | append flash:eem_alta_de_CPU.log"

action 9.3 cli command "show ip traffic | append flash:eem_alta_de_CPU.log"

I have the same issue:

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 0.5

  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"

What happens is the threshold is exceeded and a message is sent to syslog but the file is never created as if the rest of the commands never processed.

Sep 18 11:38:43.457: %HA_EM-6-LOG: High_CPU: High CPU DETECTED. Please wait - logging Information to flash:high_cpu.txt

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)