cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2318
Views
0
Helpful
1
Replies

EEM Script to bounce an interface and then reload if that doesnt fix the issue

mhefner@cisco.com
Cisco Employee
Cisco Employee

Hello, I am trying to create an EEM script that when a tracked IP SLA interface goes down, the script will do the following:

1.  Bounce the interface

2.  If that doesnt fix the issue and the tracked interface is still down, reload the router

3.  If bouncing the interface does fix the issue, then do not reload the router and delete the dynamically created EEM script.  

 

I have looked at several threads in the EEM community and have used some them to come up with my configurations.  I can get the script to bounce the the interface with no issues.  I can also get the script to dynamically create a new EEM script to reload the router.  The problem I am currently having is getting the dynamically EEM script to actually execute and reload the router.  I havent gotten far enough to test if the 3rd script will actually remove the dynamically created EEM script before the router reloads.  Can someone please advise me on the logic of my EEM scripts?  I have lowered some of the timers so i dont have to sit around and wait to have interfaces go down in my lab and for scripts to execute.

 

Thanks

 

Michael

 

ip sla 1
icmp-echo 1.1.1.2
frequency 10
ip sla schedule 1 life forever start-time now

 

track 1 ip sla 1 reachability
delay down 10 up 15

 

event manager applet TRACK-1-STATE-DOWN-INTERFACE-RESET
event track 1 state down
action 000 syslog msg "Serial Interface is Down, Reseting the interface"
action 001 cli command "enable"
action 002 cli command "config t"
action 003 cli command "event manager applet INTERFACE-RESET"
action 004 cli command "description Applet to Reset the Outside Interface due to Tracked Object State:DOWN"
action 005 cli command "enable"
action 006 cli command "config t"
action 007 cli command "interface gi0/0"
action 008 cli command "shutdown"
action 009 wait 15
action 010 cli command "no shutdown"
action 011 wait 10
action 012 cli command "end"
action 013 cli command "wr mem"


event manager environment quote "

event manager applet TRACK-1-STATE-DOWN-ROUTER-RELOAD
 event track 1 state down
 action 100 syslog msg "Track 1 Object State:DOWN Implementing ROUTER-RELOAD_EEM_APPLET"
 action 101 cli command "enable"
 action 102 cli command "config t"
 action 103 cli command "event manager applet ROUTER-RELOAD"
 action 104 cli command "event track 1 state down"
action 105 cli command "event timer countdown time 30"
action 106 cli command "syslog msg $quote Countdown Timer Starting$quote"
 action 107 cli command "action 001 cli command $quote enable$quote"
 action 108 cli command "action 002 cli command $quote wr mem$quote"
 action 109 cli command "action 003 wait 20"
 action 110 cli command "action 004 reload"


event manager applet TRACK-1-STATE-UP
event track 1 state up
action 200 syslog msg "Track 1 Object State:UP Removing all previous EEM_APPLETS"
action 201 cli command "enable"
action 202 cli command "conf t"
action 203 cli command "no event manager applet ROUTER-RELOAD"
action 204 cli command "end"
action 205 cli command "write men"

 

1 Reply 1

mdtaslimuddin1
Level 1
Level 1

is Anyone got Solution