01-31-2018 06:06 PM - edited 03-01-2019 06:22 PM
Hi everyone,
I'm in need of some assistance regarding EEM scripting. I am trying to create an EEM script that will reload a Router after an IP SLA failure. This is easily done and has been achieved but what I would like is to have the Router reload every interval while the tracked object is still down, so in essence, if the tracked object (IP SLA) is still down, reload the Router in 3 minutes. When the Router comes back up and the tracked object (IP SLA) is still down, reload it again after 3 minutes. I then have a script to remove the applet once the tracked object comes back up:
ip sla 1
icmp-echo x.x.x.x source-interface Gig0/1
frequency 10
ip sla schedule 1 start-time now life forever
!
track 1 ip sla 1 reachability
delay down 60 up 120
!
event manager applet TRACK-1-STATE-DOWN
event track 1 state down
action 1.0 cli command "enable"
action 1.1 cli command "conf t"
action 1.2 cli command "event manager applet RELOAD-COUNTDOWN"
action 1.3 cli command "event timer countdown time 60"
action 1.4 cli command "action 1.0 cli command end"
action 1.5 cli command "action 1.1 reload"
Then the below script will remove the applet once the tracked object comes back up:
event manager applet TRACK-1-STATE-UP
event track 1 state up
action 1.0 cli command "enable"
action 1.1 cli command "conf t"
action 1.2 cli command "no event manager applet RELOAD-COUNTDOWN"
action 1.3 cli command "end"
So in the 'TRACK-1-STATE-DOWN' applet, how can I get the Router to reload if the IP SLA is still down? I've also been trying to add multiple commands to one applet but I cannot figure it out, such as:
event manager applet TRACK-1-STATE-DOWN
action 1.0 cli command "enable"
action 1.1 cli command "conf t"
action 1.2 cli command "event manager applet RELOAD-COUNTDOWN"
action 1.3 cli command "event timer countdown time 60"
action 1.4 cli command "action 1.0 cli command end"
action 1.5 cli command "action 1.1 cli command "copy run start" pattern "Destination"
action 1.6 cli command "action 1.2 cli command "" "
action 1.7 cli command "action 1.3 reload"
So I'm trying to create a new applet and save the configuration before reloading the device after 60 seconds but it does not seem to be working? The command action 1.5 cli command "action 1.1 cli command "copy run start" pattern "Destination" won't take.
Thank you all!
D