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

EEM And Tcl scripts

yutan8888
Level 1
Level 1

Hi

Please teach me. How to implementation EEM.

I want use EEM this situation.

When gi1/1 detect down EEM scripts enable.

In case gi1/1 is up  within 3 seconds then finish the EEM scripts.

Another case gi1/1 down time is over 3 seconds, Then shutdown gi1/2 and gi1/3.

IOS version 12.2(46)SG.

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

You have a tight time margin here, but these EEM applet policies should work:

event manager environment quote "

event manager applet int-down

event syslog pattern "LINEPROTO-5-UPDOWN.*GigabitEthernet1/1.*changed state to down"

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "event manager applet int-down-countdown"

action 3.1 cli command "event timer countdown time 3"

action 3.2 cli command "action 1.0 cli command enable"

action 3.3 cli command "action 2.0 cli command $quote config t$quote"

action 3.4 cli command "action 3.0 cli command $quote int gi1/2$quote"

action 3.5 cli command "action 4.0 cli command $quote shutdown$quote"

action 3.6 cli command "action 5.0 cli command $quote int gi1/3$quote"

action 3.7 cli command "action 6.0 cli command $quote shutdown$quote"

action 3.8 cli command "action 7.0 cli command $quote no event manager applet int-down-countdown$quote"

action 3.9 cli command "action 8.0 cli command $quote end$quote"

action 4.0 cli command "end"

event manager applet int-up

event syslog pattern "LINEPROTO-5-UPDOWN.*GigabitEthernet1/1.*changed state to up"

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "no event manager applet int-down-countdown"

action 4.0 cli command "end"

View solution in original post

5 Replies 5

Joe Clarke
Cisco Employee
Cisco Employee

You have a tight time margin here, but these EEM applet policies should work:

event manager environment quote "

event manager applet int-down

event syslog pattern "LINEPROTO-5-UPDOWN.*GigabitEthernet1/1.*changed state to down"

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "event manager applet int-down-countdown"

action 3.1 cli command "event timer countdown time 3"

action 3.2 cli command "action 1.0 cli command enable"

action 3.3 cli command "action 2.0 cli command $quote config t$quote"

action 3.4 cli command "action 3.0 cli command $quote int gi1/2$quote"

action 3.5 cli command "action 4.0 cli command $quote shutdown$quote"

action 3.6 cli command "action 5.0 cli command $quote int gi1/3$quote"

action 3.7 cli command "action 6.0 cli command $quote shutdown$quote"

action 3.8 cli command "action 7.0 cli command $quote no event manager applet int-down-countdown$quote"

action 3.9 cli command "action 8.0 cli command $quote end$quote"

action 4.0 cli command "end"

event manager applet int-up

event syslog pattern "LINEPROTO-5-UPDOWN.*GigabitEthernet1/1.*changed state to up"

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "no event manager applet int-down-countdown"

action 4.0 cli command "end"

It's Perfect! Many thanks

There is a slight change I would make to prevent the regular expressions from matching interfaces such as Gi1/10, 1/11, etc.:

event manager environment quote "

event manager applet int-down
event syslog pattern "LINEPROTO-5-UPDOWN.*GigabitEthernet1/1,.*changed state to down"
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "event manager applet int-down-countdown"
action 3.1 cli command "event timer countdown time 3"
action 3.2 cli command "action 1.0 cli command enable"
action 3.3 cli command "action 2.0 cli command $quote config t$quote"
action 3.4 cli command "action 3.0 cli command $quote int gi1/2$quote"
action 3.5 cli command "action 4.0 cli command $quote shutdown$quote"
action 3.6 cli command "action 5.0 cli command $quote int gi1/3$quote"
action 3.7 cli command "action 6.0 cli command $quote shutdown$quote"
action 3.8 cli command "action 7.0 cli command $quote no event manager applet int-down-countdown$quote"
action 3.9 cli command "action 8.0 cli command $quote end$quote"
action 4.0 cli command "end"

event manager applet int-up
event syslog pattern "LINEPROTO-5-UPDOWN.*GigabitEthernet1/1,.*changed state to up"
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "no event manager applet int-down-countdown"
action 4.0 cli command "end"

Thank you. And another question about How to enable EEM.


SwitchA And SwitchB directly connected each other.

Trunkport(g1/1) of SwitchA connected to Trunkport(g1/1) of SwitchB.


When tracking interface(g1/2) is down in SwitchA, SwitchB enable EEM.

Interface(g1/2) is not directly connected each other.

Interface g1/2 is L2 accessport.
Can't assign ip address.
Dou you have good idea?

Start a new thread for this question.  Also, it would help if you try and explain exactly what you want to do in more details.