cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1140
Views
0
Helpful
4
Replies

Help: EEM Scripting

rpeasah
Level 1
Level 1

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

Joe Clarke
Cisco Employee
Cisco Employee

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"

View solution in original post

4 Replies 4

Joe Clarke
Cisco Employee
Cisco Employee

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"

Awesome. Problem solved. Thx a bunch!

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.

Start a new thread to discuss this new issue.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: