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-28-2013 10:46 AM
In only uses the username for authorization. Authentication is not done.
10-30-2013 10:46 PM
The way this is written doesn't make a lot of sense. I think you want:
event manager applet APP-1
event track 1 state up
action 001 cli command "enable"
action 002 cli command "show clock"
action 003 regexp "([0-9]+):[0-9]:[0-9]" $_cli_result match hour
action 004 if $hour ge 9
action 005 if $hour le 18
action 006 cli command "conf t"
action 007 cli command "ip sla 2"
action 008 cli command "icmp-echo x.x.x.x source-ip x.x.x.x"
action 009 cli command "frequency 30"
action 010 cli command "ip sla schedule 2 life forever start-time now"
action 011 end
action 012 end
10-27-2013 01:57 PM
I really don't understand why you have both a cron timer and an IPSLA event here. If you just want to react to one IPSLA collector issue and configure another one depending on the condition, remove the cron event.
10-27-2013 08:44 PM
Joseph,
Had already tested without the cron event but the result is the same. Intially cron was configured to run the script only during buisness hours. So if would would like to run a script only during buisness hours with IPSLA what do you suggest?
Regards,
Sathvik
10-28-2013 06:53 AM
Have a look at the applets in https://supportforums.cisco.com/message/4025820#4025820 . That will show you how to extract the "hours" portion of show clock then test against that to see if you're within your business hours window.
10-28-2013 07:19 AM
Thanks Joseph will check on that.
Regards,
Sathvik
10-28-2013 07:31 AM
Joseph,
Wanted some some guidance using event manager session cli username USER-NAME. If i would like to authenticate the user using TACACS or RADIUS server how would it work.
Which all ways can be used to authenticate user before running a script.
Regards,
Sathvik K V
10-28-2013 10:26 AM
It works the same. Just make sure the USER-NAME is known to TACACS or Radius.
10-28-2013 10:37 AM
So password should be provided in the script : action 10 cli command "password"
Mentioning password in the script is not suggested. Is there any other option that could be used??
Regards,
Sathvik
10-28-2013 10:40 AM
No, passwords are not required and not used. You only need to specify the username.
10-28-2013 10:45 AM
Thank you will try the script now.
Just curious to know how would it work without a password
10-28-2013 10:46 AM
In only uses the username for authorization. Authentication is not done.
10-28-2013 12:32 PM
Joseph,Thank you for the support
10-30-2013 09:52 AM
Hi Joseph,
I would like to run the script pasted below during buisness hours(9am to 6pm). When two if conditions are used is it the first condition is checked and if that passes it will check the second condition.
event manager applet APP-1
event track 1 state up
action 001 cli command "enable"
action 002 cli command "show clock"
action 003 regexp "([0-9]+):[0-9]:[0-9]" $_cli_result match hour
action 004 if $hour ge 9
action 005 cli command "conf t"
action 006 cli command "ip sla 2"
action 007 cli command "icmp-echo x.x.x.x source-ip x.x.x.x"
action 008 cli command "frequency 30"
action 009 cli command "ip sla schedule 2 life forever start-time now"
action 010 end
action 011 if $hour le 18
action 012 cli command "ip sla 2"
action 013 cli command "icmp-echo x.x.x.x source-ip x.x.x.x"
action 014 cli command "frequency 30"
action 015 cli command "ip sla schedule 2 life forever start-time now"
action 016 end
event manager applet APP-2
event track 1 state down
action 10 cli command "enable"
action 20 cli command "conf t"
action 30 cli command "no ip sla 2"
action 40 cli command "end"
Regards,
Sathvik
10-30-2013 10:46 PM
The way this is written doesn't make a lot of sense. I think you want:
event manager applet APP-1
event track 1 state up
action 001 cli command "enable"
action 002 cli command "show clock"
action 003 regexp "([0-9]+):[0-9]:[0-9]" $_cli_result match hour
action 004 if $hour ge 9
action 005 if $hour le 18
action 006 cli command "conf t"
action 007 cli command "ip sla 2"
action 008 cli command "icmp-echo x.x.x.x source-ip x.x.x.x"
action 009 cli command "frequency 30"
action 010 cli command "ip sla schedule 2 life forever start-time now"
action 011 end
action 012 end
10-30-2013 10:50 PM
Okie will check this. So a nested IF condition should be used.
Not much knowledge on EEM
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: