07-13-2022 03:00 AM
I have two EEM applets - one to shut a port down when an IP SLA measurement fails. That works fine. Then a second script when a tracking object determines the IP SLA measurement has restarted. Object tracking seems to have been removed in EEM 4.0 under 17.6 for Cat9200L so I am having to use a syslog pattern. This will not register and hence never triggers?
event manager applet fast_failover
event ipsla operation-id 1 reaction-type timeout
action 1.0 if $_ipsla_condition eq "Occurred"
action 1.1 cli command "enable"
action 1.2 cli command "conf t"
action 1.3 cli command "interface G1/0/1"
action 1.4 cli command "shut"
action 1.5 syslog msg "EEM Script Activated"
action 1.6 end
event manager applet recover
event syslog pattern "%TRACK-6-STATE: 1 ip sla 1 state Down -> Up"
action 1.0 cli command "enable"
action 1.1 cli command "conf t"
action 1.2 cli command "interface fa1/0/1"
action 1.3 cli command "no shut"
action 1.4 syslog msg "EEM Script recover activated"
action 1.5 end
!
end
sh event manager policy registered
No. Class Type Event Type Trap Time Registered Name
1 applet user ipsla Off Wed Jul 13 08:09:40 2022 fast_failover
operation-id {1} reaction-type {timeout}
maxrun 20.000
action 1.0 if $_ipsla_condition eq "Occurred"
action 1.1 cli command "enable"
action 1.2 cli command "conf t"
action 1.3 cli command "interface G1/0/1"
action 1.4 cli command "shut"
action 1.5 syslog msg "EEM Script Activated"
action 1.6 end
Client Policies
No. Class Type Event Type Trap Time Registered Name
1 CH user timer cron Off Wed Jul 13 08:09:40 2022 CiscoTAC-1
Solved! Go to Solution.
07-14-2022 07:30 AM
Remove "action 1.5 end" in the recover policy. There is no conditional block to "end" in this policy. It is needed in the first policy since there is an "if" block.
07-13-2022 06:06 AM
can I see the config of IP SLA ?
07-13-2022 06:21 AM
track 1 ip sla 1 state
delay down 5 up 15
ip sla 1
icmp-echo 8.8.8.8 source-interface Vlan20
threshold 50
timeout 1000
frequency 1
ip sla schedule 1 life forever start-time now
ip sla reaction-configuration 1 react timeout threshold-type immediate action-type trapOnly
ip sla logging traps
ip sla enable reaction-alerts
07-13-2022 06:23 AM
I meant to add this is the syslog message I am trying to match
002452: Jul 13 2022 12:13:29.740 UTC: %TRACK-6-STATE: 1 ip sla 1 state Down -> Up
07-13-2022 06:39 AM
I see the will do test it and see where is issue here,
but
the first EEM event for IP SLA timeout, here IP SLA also need to change from UP->DOWN
which then by second EEM event the IP SLA will change from DOWN ->UP,
from first view it can be the timeout reaction is detect but the IP SLA still UP and hence the status change of second EEM is never hit.
so until I check the config
do check if you get reaction timeout, are the track is UP or Down ?
07-13-2022 06:51 AM
Hi I think the problem is the second EEM doesn't register.
When I issue the show event manager policy registered it only shows the first applet. I then ran the command again adding the applet name recover and the switch crashed and reloaded. I am running 17.6.3 which the latest version of code and the recommended release by Cisco TAC. I am attempting to get a case raise with them to investigate
07-14-2022 07:30 AM
Remove "action 1.5 end" in the recover policy. There is no conditional block to "end" in this policy. It is needed in the first policy since there is an "if" block.
07-14-2022 08:01 AM
Many thanks - been driving mad
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