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

Help with EEM configuration on 860 Router

JON O'NAN
Level 1
Level 1

Can someone help me with a EEM configuration that would reset an interface on the router and force a re-dhcp when connectivity is lost to an upstream router? I would like the applet to run every 15 minutes. I am thinking of an event that is triggered to do a shut/no shut on the interface when 5 pings are lost.

Thanks in advance

Jon

5 Replies 5

andrew.prince
Level 10
Level 10

This is a simple thing - you just need the EEM script to look for the syslog event of an IP SLA monitor to alert of 5 dropped pings, nothing major.

However - you could also just write the simple EEM script to shut and open the interface, and attach the EEM script to a kron schedule that runs every 15 minutes....... or both!!!!

Thanks for your reply. Conceptually I know exactly what you are talking about. I cannot figure out the commands. Can the cron schedule be written to only schedule the interface reset based on the 5 missed pings? What is the cron command format for every 15 minutes? This is what I tried but was causing a constant interface reset:

event manager applet redhcp

event tag 1.0 cli pattern "ping 192.168.1.1" sync yes occurs 32 period 60 maxrun 60

  event tag 2.0 syslog pattern "..."

trigger occurs 1 delay 50

  correlate event 1.0 or event 2.0

  attribute tag 1.0 occurs 1

  attribute tag 2.0 occurs 1

action 1.0 cli command "enable"

action 2.0 cli command "config terminal"

action 4.0 cli command "interface fastethernet 4"

action 5.0 cli command "shutdown"

action 6.0 cli command "no shutdown"

action 91.0 cli command "exit"

action 99.0 cli command "show run interface fastethernet 4"

Try - this runs every 15 mins...

kron occurrence <> in 15 recurring

policy-list <>

kron policy-list <>

cli event manager run <>

event manager applet << EEM NAME 1>>

event none

action 1.0 cli command "enable"

action 1.1 cli command "conf t"

action 1.2 cli command "interface  <>"

action 1.3 cli command "shut"

action 1.4 cli command "end"

action 1.5 syslog msg "*** EEM has closed <> ***"

exit

event manager applet <>

event syslog pattern "%LINEPROTO-5-UPDOWN: Line protocol on Interface <>, changed state to down"

action 1.0 cli command "enable"

action 1.1 cli command "conf t"

action 1.2 cli command "interface  <>"

action 1.3 cli command "no shut"

action 1.4 cli command "end"

action 1.5 syslog msg "*** EEM has opened <> ***"

exit

Andrew, Thanks.

How do you get these two applets to trigger based on the 5 missed pings and stop when reachability returns? Do I need an IP SLA?

Yes - the posted runs every 15 mins.  if you don't want that anymore, then configure an IP SLA, then trigger on the syslog IP SLA down log event - is the easyiest way.