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

Help: EEM Scripting

I can do with some eem scripting help. Here is what I'm trying to do:

  1. When my g0/1/0 interface goes down I want to shut down my p0/0/0 interface.
  2. When the g0/1/0 comes back up I want to wait like 5 minutes and then bring p0/0/0 up.

Here's what I've come up with:


when g0/1/0 goes down

event manager applet GIG-0-1-0_DOWN
event syslog pattern "Interface GigabitEthernet0/1/0, changed state to down"
action 1.0 cli command "enable"
action 1.1 cli command "configure term"
action 1.2 cli command "interface p0/0/0"
action 1.3 cli command "shut"
action 1.4 cli command "end"

when g0/1/0 comes up


event manager applet GIG-0-1-0_UP
event syslog pattern "Interface GigabitEthernet0/1/0, changed state to up"
action 1.0 cli command "enable"
action 1.1 cli command "configure term"
action 1.2 cli command "interface p0/0/0"
action 1.3 cli command "no shut"
action 1.4 cli command "end"

When g0/1/0 comes up I want to wait 5 minutes before bringing up p0/0/0.

1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Re: Help: EEM Scripting

Try this configuration:

event manager environment quote "

event manager applet GIG-0-1-0_DOWN

event syslog pattern "Interface GigabitEthernet0/1/0, changed state to down"
action 1.0 cli command "enable"
action 1.1 cli command "configure term"
action 1.2 cli command "interface p0/0/0"
action 1.3 cli command "shut"

action 1.4 cli command "no event manager applet P-0-0-0_UP"
action 1.5 cli command "end"

event manager applet GIG-0-1-0_UP

event syslog pattern "Interface GigabitEthernet0/1/0, changed state to up"
action 1.0 cli command "enable"
action 1.1 cli command "configure term"
action 1.2 cli command "event manager applet P-0-0-0_UP"

action 1.3 cli command "event timer countdown time 300"

action 1.4 cli command "action 1.0 cli command $quote enable$quote"

action 1.5 cli command "action 1.1 cli command $quote config t$quote"

action 1.6 cli command "action 1.2 cli command $quote int p0/0/0$quote"

action 1.7 cli command "action 1.3 cli command $quote no shut$quote"

action 1.8 cli command "action 1.4 cli command $quote no event manager applet P-0-0-0_UP$quote"

action 1.9 cli command "action 1.5 cli command $quote end$quote"

action 2.0 cli command "end"

4 REPLIES
Cisco Employee

Re: Help: EEM Scripting

Try this configuration:

event manager environment quote "

event manager applet GIG-0-1-0_DOWN

event syslog pattern "Interface GigabitEthernet0/1/0, changed state to down"
action 1.0 cli command "enable"
action 1.1 cli command "configure term"
action 1.2 cli command "interface p0/0/0"
action 1.3 cli command "shut"

action 1.4 cli command "no event manager applet P-0-0-0_UP"
action 1.5 cli command "end"

event manager applet GIG-0-1-0_UP

event syslog pattern "Interface GigabitEthernet0/1/0, changed state to up"
action 1.0 cli command "enable"
action 1.1 cli command "configure term"
action 1.2 cli command "event manager applet P-0-0-0_UP"

action 1.3 cli command "event timer countdown time 300"

action 1.4 cli command "action 1.0 cli command $quote enable$quote"

action 1.5 cli command "action 1.1 cli command $quote config t$quote"

action 1.6 cli command "action 1.2 cli command $quote int p0/0/0$quote"

action 1.7 cli command "action 1.3 cli command $quote no shut$quote"

action 1.8 cli command "action 1.4 cli command $quote no event manager applet P-0-0-0_UP$quote"

action 1.9 cli command "action 1.5 cli command $quote end$quote"

action 2.0 cli command "end"

New Member

Re: Help: EEM Scripting

Awesome. Problem solved. Thx a bunch!

New Member

Re: Help: EEM Scripting

I need some more help taking this a little bit further as follows:

When both g0/1/0 AND g0/1/1 go down, shut down p0/0/0.

When either g0/1/0 OR g0/1/1 comes back up, wait 5 mins and if either is still up, bring up p0/0/0. While waiting, if the link that is up goes down, reset the countdown timer.

Cisco Employee

Re: Help: EEM Scripting

Start a new thread to discuss this new issue.

664
Views
0
Helpful
4
Replies
CreatePlease to create content