10-27-2013 07:00 AM
Hi,
I have a scenario where i would like to execute a EEM applet for running an ip sla event when othe ip sla event is up. Just to summarize an IP sla event success should trigger anothe IP sla event. I have tried the two options below but was not able to find any debug logs.
ip sla 10
icmp-jitter x.x.x.x source-ip x.x.x.x num-packets 10
frequency 30
ip sla schedule 10 life forever start-time now
ip sla 20
icmp-jitter x.x.x.x source-ip x.x.x.x num-packets 10
frequency 30
event manager applet SLA
event timer cron cron-entry "5 * * * *"
event ipsla operation-id 10 reaction-type timeout
action 10 if $_ipsla_condition eq "Occurred"
action 15 cli command "enable"
action 20 cli command "configure term"
action 25 cli command "no ip sla schedule 20 life forever start-time now"
action 30 else
action 35 cli command "enable"
action 40 cli command "configure term"
action 45 cli command "ip sla schedule 20 life forever start-time now"
action 50 end
OR
ip sla 10
icmp-jitter x.x.x.x source-ip x.x.x.x num-packets 10
frequency 30
ip sla schedule 10 life forever start-time now
ip sla 20
icmp-jitter y.y.y.y source-ip y.y.y.y num-packets 10
frequency 30
track 1 ip lsa reachability
event manager applet SLA-1
event timer cron cron-entry "5 * * * *"
event track 1 state up
action 10 cli command "enable"
action 20 cli command "conf t"
action 30 cli command "ip sla schedule 20 life forever start-time now"
action 40 cli command "end"
event manager applet SLA-2
event timer cron cron-entry "5 * * * *"
event track 1 state down
action 10 cli command "enable"
action 20 cli command '' conf t"
action 30 cli command "no ip sla schedule 20 life forever start-time now"
action 40 cli command "end"
Regards,
Sathvik K V
Solved! Go to Solution.
10-30-2013 11:15 PM
Changed this line and it worked thank you
10-30-2013 11:37 PM
Hi Joseph,
I justed tried the script with action 004 if $hour ge 9 and action 005 if $hour le 12 and it didnt work. Time now is 12:05 but still script went on to execute ip sla.
Regards,
Sathvik
10-30-2013 11:40 PM
Of course, because the hour is le 12. You should change that to lt so it will stop after 11:59.
10-30-2013 11:46 PM
Joseph, i meant after changing to 005 if $hour le 12 and the time current time on the device is 12:10 the script still configures IPSLA. I want the script to configure IPSLA only between 9 to 12.
10-30-2013 11:47 PM
Right. The hour is stil 12. 12 le 12, so it makes sense the script still works. As I said, change to lt 12, then you will get what you want.
10-30-2013 11:48 PM
ohh got the answer to my question, im matching only hours thanks
10-31-2013 02:37 AM
Joseph, for a IOS that doesnt support regular expression is there any way to configure EEM to run in a given time frame?
10-31-2013 09:39 AM
You'll need to convert to Tcl using http://www.marcuscom.com/convert_applet then install a Tcl policy. The converted Tcl code should work as-is, though.
10-31-2013 08:52 PM
Thank you thats very helpful.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide