cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1594
Views
0
Helpful
2
Replies

regular syslog message during condition

leogal777
Level 1
Level 1

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

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

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.

View solution in original post

2 Replies 2

Joe Clarke
Cisco Employee
Cisco Employee

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.

Thank you Joe

:-) I took it from the wrong side.