EEM - action mail

It is possible to set up an EEM script to send out email alerts as an action. This can be achieved using the action mail command.

An example configuration that can achieve this can be seen below, in conjunction with an IP SLA trigger.

ip sla 1 icmp-echo source-interface threshold 200 timeout 1000 frequency 10 ip sla schedule 1 life forever start-time now
event manager applet IP-SLA-FAIL event ipsla operation-id 1 reaction-type timeout action 1.0 mail server "" to "" from "" subject "IP SLA Failure" body "IP SLA monitoring has failed for IP: "

Using the action mail command, and the appropriate email server setup and parameters, these commands will cause an email alert to be sent, triggered by the failure in the IP SLA.

Links:

https://forum.networklessons.com/t/ip-sla-and-eem-script/1334/17?u=lagapides

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/eem/command/eem-cr-book.pdf