So, I was stuck trying to emulate IP SLA/track behavior on ME3400 metroethernet switches. Dunno why, the ones I got don't have IP SLA + TRACK commands, they do have IP SLA, but not track. The config manual for them says they do have track, somehow, the ones we use at work don't.
So I got to work with what I have, right?
After a bit of fumbling, I finally made it work, that's the config on the ME3400 on site A:
ip sla 1
icmp-echo 2.2.2.2 source-ip 1.1.1.1
timeout 1000
threshold 1000
frequency 1
ip sla schedule 1 life forever start-time now
ip sla reaction-configuration 1 react timeout threshold-type consecutive 3 action-type trapOnly
ip sla reaction-configuration 1 react rtt threshold-value 1000 3000
ip sla enable reaction-alerts
event manager applet RTT-Down
event syslog pattern "%RTT-4-OPER_TIMEOUT: condition occurred, entry number = 1"
action 0.0 cli command "enable"
action 0.1 cli command "conf t"
action 1.0 cli command "interface Gi0/1"
action 2.0 cli command "shut"
action 3.0 syslog msg "interface-shut EEM shut down interface Gi0/1"
event manager applet RTT-Up
event syslog pattern "%RTT-4-OPER_TIMEOUT: condition cleared, entry number = 1"
action 0.0 cli command "enable"
action 0.1 cli command "conf t"
action 1.0 cli command "interface Gi0/1"
action 2.0 cli command "no shut"
action 3.0 syslog msg "interface EEM brought up interface Gi0/1"
!
There's the log on ME3400-A when the ME3400-B went down:
Jun 1 00:06:12.228: %RTT-4-OPER_TIMEOUT: condition occurred, entry number = 1
Jun 1 00:06:12.480: %E_CFM-6-ENTER_AIS_INT: Interface GigabitEthernet0/1 enters AIS defect condition for Down direction
Jun 1 00:06:12.597: %HA_EM-6-LOG: RTT-Down: interface-shut EEM shut down interface Gi0/1
Jun 1 00:06:12.606: %SYS-5-CONFIG_I: Configured from console by vty1
Jun 1 00:06:14.485: %LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to administratively downJun 1 00:06:15.491: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down
Notice it took a few seconds between failure and the "automatic" shutdown of the ME3400-A LAN Interface.
There's the log on ME3400-A when ME3400 came back up:
Jun 1 00:08:13.223: %RTT-4-OPER_TIMEOUT: condition cleared, entry number = 1
Jun 1 00:08:13.432: %HA_EM-6-LOG: RTT-Up: GVT IT Network - interface EEM brought up interface Gi0/1
Jun 1 00:08:13.441: %SYS-5-CONFIG_I: Configured from console by vty1
Jun 1 00:08:15.328: %LINK-3-UPDOWN: Interface GigabitEthernet0/1, changed state to down
Jun 1 00:08:17.769: %LINK-3-UPDOWN: Interface GigabitEthernet0/1, changed state to up
Jun 1 00:08:18.776: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up
Jun 1 00:08:18.776: %E_CFM-6-EXIT_AIS_INT: Interface GigabitEthernet0/1 exited AIS defect condition for Down direction
On the Router where the ME3400-A is connected you can see both events, when it goes down and when it comes back up.
May 31 20:49:01.881: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to down
May 31 20:49:02.881: %LINK-3-UPDOWN: Interface GigabitEthernet0/2, changed state to down
May 31 20:51:05.881: %LINK-3-UPDOWN: Interface GigabitEthernet0/2, changed state to up
May 31 20:51:06.881: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to up
I know it's a simple script. I am quite happy with it, nonetheless.