02-04-2016 01:18 AM
Hello gents,
I would like to create EEM applet, that will monitor a link, when that link goes down it will send a syslog message every minute until the moment the link comes back up.
I have this functioning
ip sla 11
icmp-echo 172.25.5.2
threshold 50
timeout 500
frequency 1
ip sla schedule 11 life forever start-time now
ip sla reaction-configuration 11 react timeout threshold-type immediate
ip sla enable reaction-alerts
event manager applet sla1
event ipsla operation-id 1 reaction-type timeout
action 100 syslog msg "Bla bla bla $_ipsla_react_type $_ipsla_condition"
But I am struggling with that timing and regular messages during indefinite interval, maxrun etc.
Can anyone please suggest how to do this?
Thank you
Leo
Solved! Go to Solution.
02-04-2016 06:37 AM
The event you're using is edge-triggered. If you really want to generate a syslog every minute (I honestly wouldn't recommend this as operators might learn to ignore the "noise"), then use a timer ED:
event manager applet sla1
event timer watchdog time 60
action 1.0 cli command "enable"
action 2.0 cli command "show ip sla stat 1"
action 3.0 regexp "Timeout" "$_cli_result"
action 4.0 if $_regexp_result eq 1
action 5.0 syslog msg "..."
action 6.0 end
You may want to extract more from the CLI output to populate your syslog.
02-04-2016 06:37 AM
The event you're using is edge-triggered. If you really want to generate a syslog every minute (I honestly wouldn't recommend this as operators might learn to ignore the "noise"), then use a timer ED:
event manager applet sla1
event timer watchdog time 60
action 1.0 cli command "enable"
action 2.0 cli command "show ip sla stat 1"
action 3.0 regexp "Timeout" "$_cli_result"
action 4.0 if $_regexp_result eq 1
action 5.0 syslog msg "..."
action 6.0 end
You may want to extract more from the CLI output to populate your syslog.
02-04-2016 06:56 AM
Thank you Joe
:-) I took it from the wrong side.
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