EEM script to alert on IP SLA failures

Answered Question
Aug 24th, 2012
User Badges:
  • Blue, 1500 points or more

I have the following IP SLA set up and would like to do the following. I would like to have a log entry if any of the below have a failure and then send an email alerting to that failure. Is there a way to do this with EEM?


ip sla 1010

udp-jitter 64.xxx.xxx.xxx 3456 num-packets 30 interval 25

history hours-of-statistics-kept 24

ip sla schedule 1010 life forever start-time now


ip sla 1011

tcp-connect 64.xxx.xxx.xxx 2000

history hours-of-statistics-kept 24

ip sla schedule 1011 life forever start-time now


ip sla 1012

icmp-echo 64.xxx.xxx.xxx

frequency 30

history hours-of-statistics-kept 24

history distributions-of-statistics-kept 10

ip sla schedule 1012 life forever start-time now



Thanks,

Mike

Correct Answer by Joe Clarke about 4 years 10 months ago
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Correct Answer
Joe Clarke Fri, 08/24/2012 - 09:28
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

burleyman Fri, 08/24/2012 - 11:29
User Badges:
  • Blue, 1500 points or more

Thanks that is very helpful. Now what about something like this?

From below I would like to alert if there is a failure (see the bold)


IP_SLA_2821#show ip sla stat 1020
IPSLAs Latest Operation Statistics

IPSLA operation id: 1020
Type of operation: udp-jitter
Latest RTT: 23 milliseconds
Latest operation start time: 14:25:34.377 EDT Fri Aug 24 2012
Latest operation return code: OK
RTT Values:
Number Of RTT: 30  RTT Min/Avg/Max: 23/23/33 milliseconds
Latency one-way time:
Number of Latency one-way Samples: 30
Source to Destination Latency one way Min/Avg/Max: 9/10/16 milliseconds
Destination to Source Latency one way Min/Avg/Max: 13/13/23 milliseconds
Jitter Time:
Number of SD Jitter Samples: 29
Number of DS Jitter Samples: 29
Source to Destination Jitter Min/Avg/Max: 0/1/6 milliseconds
Destination to Source Jitter Min/Avg/Max: 0/1/10 milliseconds
Packet Loss Values:
Loss Source to Destination: 0  Loss Destination to Source: 0
Out Of Sequence: 0 Tail Drop: 0
Packet Late Arrival: 0 Packet Skipped: 0
Voice Score Values:
Calculated Planning Impairment Factor (ICPIF): 0
Mean Opinion Score (MOS): 0
Number of successes: 33
Number of failures: 0
Operation time to live: Forever

Joe Clarke Fri, 08/24/2012 - 12:07
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

That's what the EOT example I gave should give you.

burleyman Fri, 08/24/2012 - 13:43
User Badges:
  • Blue, 1500 points or more

Sorry, I misunderstood. I thought it was just for the ICMP and would be different for the others. Thank you for your help and I will try it out.


Mike

Actions

This Discussion

Related Content