IPSLA and EEM Scripts

Example :

IP SLA check 1.1.1.1 reachable via gi 0/0, if no shutdown the port G0/1
========================================================================


ip sla 11
icmp-echo 1.1.1.1 source-interface GigabitEthernet0/0
ip sla schedule 11 life forever start-time now
ip sla reaction-configuration 11 react timeout threshold-type immediate
ip sla enable reaction-alerts

track 11 ip sla 11 reachability
delay down 8 up 10

event manager applet shut_int
event ipsla operation-id 11 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 gi0/1"
action 1.4 cli command "shut"
action 1.5 syslog msg "End of EEM"
action 1.6 end