Help: EEM Scripting

Answered Question
Feb 16th, 2010

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.

I have this problem too.
0 votes
Correct Answer by Joe Clarke about 6 years 11 months ago

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"

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Correct Answer
Joe Clarke Tue, 02/16/2010 - 17:48

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"

rpeasah Wed, 03/03/2010 - 17:49

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.

Actions

This Discussion