The IP Service Level Agreement (SLA) measurement feature of Cisco IOS is extremely SNMP-oriented. For example, there is no easy way to generate a logging message when an SLA operation fails (or exceeds the threshold). However, Embedded Event Manager reading SNMP variables can help you get there.Before checking the status of an SLA operation, you need to schedule it (remember the SLA entry#, you'll need it when forming the SNMP object ID). For example:
ip sla 42When the SLA measurement has been defined, create an EEM applet to monitor the status of the rttMonCtrlOperTimeoutOccured variable in the CISCO-RTT-MON MIB (note that the SLA entry# is the last number in the OID). The EEM applet triggers on value 1 (true: timeout) and re-arms on value 2 (false: no timeout).
icmp-echo 172.16.1.2 source-interface Serial0/0/0.100
ip sla schedule 42 life forever start-time now
event manager applet SLA_TimeoutSimilarly, you can write an applet that triggers on SLA response time being over threshold by monitoring SNMP OID 184.108.40.206.220.127.116.11.18.104.22.168.1.7.sla# (the rttMonCtrlOperOverThresholdOccurred variable).
event snmp oid 22.214.171.124.126.96.36.199.188.8.131.52.1.6.42 get-type exact entry-op eq entry-val 1 exit-op eq exit-val 2 poll-interval 5
action 1.0 syslog msg "Ping to 172.16.1.2 timeout"
Note: this article is part of You've asked for it series.