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

EEM loop

rcsco2011
Level 1
Level 1

please help me to make loop for EEM script below

1. if track 1 is down, start action commands

2. if track 1 is up, stop action commands

3. loop EEM below until track 1 is up

 

event manager applet 4GReset authorization bypass
event track 1 state down maxrun 30000000
action 1.0 wait 300
action 1.1 track read 1
action 1.2 if $_track_state eq up
action 1.3 puts "track is up"
action 1.4 else
action 1.5 cli command "enable"
action 1.6 wait 3
action 1.7 cli command "test cellular 0/1/0 modem-power-cycle"
action 1.8 wait 300
<while loop>
action 1.9 end

 

5 Replies 5

balaji.bandi
Hall of Fame
Hall of Fame

Have i missed anything here?

 

you script already tracking and if up take an action, you can also make another action based on the track item if down.

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Hi Balaji

 

Thank you for your reply.

yes it is working to send action commands when Track is down over 5 min and stop action if track up within 5 min

but EEM is not working properly if track is still down after action command

 

for example, when track is down, EEM will wait 5 min to see Track status change. if track is down, it will send commands.

if track is up, it will stop.

but if track is still down, i want to keep send command every 5 to 10min so i need loop to repeat EEM until track is up

 

Thank you

Jae

 

Can you post full track / any SLA config along with some Logs track up and down to analyse and suggest better.

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

ip sla 1
icmp-echo x.x.x.x source-interface loopback0 <- use Core Lo IP
tos 160
frequency 30
ip sla schedule 1 life forever start now

track 1 ip sla 1 reachability
delay down 10 up 10

 

event manager applet 4GReset authorization bypass
event track 1 state down maxrun 30000000 <- check track status changes from up to down
action 1.0 wait 300 <- wait 5 min if track status changes from up to down
action 1.1 track read 1 <- read track 1 status
action 1.2 if $_track_state eq up <- if track is up, stop and put "track is up" below 
action 1.3 puts "track is up"
action 1.4 else <- if not, 
action 1.5 cli command "enable" <- send command
action 1.6 wait 3 <- wait
action 1.7 cli command "test cellular 0/1/0 modem-power-cycle" <- send command
action 1.8 wait 300 <- wait until 4G module reset 
action 1.9 end

 

it is working but sometimes, we need to reset more than 1 time to get new parameter.

so after 1.8, i want to start process again from 1.0 if track is still down.

when track status changes to up, it will stop.

 

please advice me if we can make loop for this

 

Thank you

 

Hi,

 

Did you every find a fix for this?

 

thanks

 

Simon

 

Review Cisco Networking for a $25 gift card