cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4223
Views
9
Helpful
23
Replies

EEM applet for IPSLA

sathvik k v
Level 3
Level 3

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

23 Replies 23

Changed this line and it worked thank you

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

Of course, because the hour is le 12.  You should change that to lt so it will stop after 11:59.

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.

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.

ohh got the answer to my question, im matching only hours thanks

Joseph, for a IOS that doesnt support regular expression is there any way to configure EEM to run in a given time frame?

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.


Thank you thats very helpful.