01-06-2014 12:25 PM
Hi,
I have setup an IP SLA on my cisco 3850 switch internally. Everything is working great! What i need to know is how can i setup an Embedded Event Manager (EEM) email alert on my 3850 so when the IP SLA does occur i want an email triggered informing me. Same goes for when IP SLA returns back to primary route.
Your help is appreciated immensely.
Saif
Solved! Go to Solution.
01-21-2014 02:31 PM
So sorry to bother you again, but is this is how it is suppose to look:
ip sla 1
icmp-echo 8.8.8.8 source-ip 192.168.10.1
frequency 5
ip sla schedule 1 life forever start-time now
ip sla reaction-configuration 1 react timeout threshold-type immediate
ip sla enable reaction-alerts
track 1 ip sla 1 reachability
delay down 90 up 90
event manager environment _email_server
event manager environment _email_from IPSLA@domain.local
event manager environment _email_to IPSLA@domain.local
event manager applet ISPCheck
event ipsla operation-id 1 reaction-type timeout
action 1.0 if $_ipsla_condition eq "Occurred"
action 1.1 syslog msg "Primary Internet Circuit Down"
action 1.2 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "Circuit Down" body "Primary Internet Circuit Down."
action 1.3 else
action 1.4 syslog msg "Primary Internet Circuit UP"
action 1.5 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "Circuit UP" body "Primary Internet Circuit UP."
action 1.6 end
thanks,
01-21-2014 08:55 PM
Looks good to me.
01-23-2014 01:10 PM
ok back again!
Everything is in, but i am getting timeout error when sending email:
*Jan 23 14:28:10.464: %HA_EM-3-FMPD_SMTP: Error occurred when sending mail to SMTP server: username:password@mail.mydomain.com : timeout error
below is the script that is being used:
event manager environment _email_server username:password@mail.mydomain.local
event manager environment _email_from IPSLA@mydomain.local
event manager environment _email_to IPSLA@mydomain.local
event manager applet ISPCheck
event ipsla operation-id 1 reaction-type timeout
action 1.0 if $_ipsla_condition eq "Occurred"
action 1.1 syslog msg "Primary Internet Circuit Down"
action 1.2 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "Circuit Down" body "Primary Internet Circuit Down."
action 1.3 else
action 1.4 syslog msg "Primary Internet Circuit UP"
action 1.5 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "Circuit UP" body "Primary Internet Circuit UP."
action 1.6 end
i feel like we're almost there.....
01-23-2014 02:36 PM
Can you telnet to your email server on port 25 from the switch:
telnet mail.mydomain.local 25
That needs to work before the device can send email.
01-23-2014 02:44 PM
I am not able to telnet using hostname, but i am able to telnet using ip address I get:
Trying 122.x.x.x, 25 ... Open
220 *************************************************************************************
500 5.5.1 Command unrecognized: "XXXX XXXXXXXXXXXXXXXXXXXXXX"
so i changed event manager environment _email_server username:password@mail.mydomain.local to use the IP as such:
event manager environment _email_server username:password@122.x.x.x
i still get timeout error
thanks
01-23-2014 02:54 PM
Does your username contain an '@'? Enable "debug event manager action mail" and collect the additional output. Do you need to use a VRF to connect to your mail server?
01-23-2014 03:05 PM
OK so this is what is happening:
From the failedover isp (secondary isp) when i bring up primary isp i get: it is successful and i get an email
But for the primary isp i get error and email fails.
I believe it could be becuase the primary cirucut is disconnected and not connected to the internet and it has not switched over to the secondary ISP yet so that is why its not sending an email. And it works the otherway around because the secondary ISP is always connected?
How can i delay the sending of email upon DOWN? i want to make sure it completely switches over and then sends me an email.
10-24-2018 04:39 AM
Joe,
I have set this up and it works. My question is that i have 4 x IP SLA's on my 3850 switch
How can i monitor all 4
event ipsla reaction-type timeout operation-id 1
event ipsla reaction-type timeout operation-id 2
event ipsla reaction-type timeout operation-id 3
event ipsla reaction-type timeout operation-id 4
Once i add in
event ipsla reaction-type timeout operation-id 2
it deletes
event ipsla reaction-type timeout operation-id 1
I dont know how to get around this scenario
01-24-2014 01:28 PM
OK i figured it out.
It was simple, but since i didnt know and had to research it, it took me couple of hours.
i had to input 'wait' command for the script to delay.
final output:
event manager applet ISPCheck
event ipsla operation-id 1 reaction-type timeout
action 1.0 if $_ipsla_condition eq "Occurred"
action 1.1 wait 8
action 1.2 syslog msg "Primary Internet Circuit Down"
action 1.3 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "Circuit Down" body "Primary Internet Circuit Down."
action 1.4 else
action 1.5 syslog msg "Primary Internet Circuit UP"
action 1.6 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "Circuit UP" body "Primary Internet Circuit UP."
action 1.7 end
Thank you so much Joseph for your insight and patience.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide