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 And Tcl scripts

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.

Everyone's tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Re: EEM And Tcl scripts

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"

5 REPLIES
Cisco Employee

Re: EEM And Tcl scripts

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"

New Member

Re: EEM And Tcl scripts

It's Perfect! Many thanks

Cisco Employee

Re: EEM And Tcl scripts

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"
New Member

Re: EEM And Tcl scripts

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?

Cisco Employee

Re: EEM And Tcl scripts

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.

1036
Views
0
Helpful
5
Replies