cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
9048
Views
0
Helpful
23
Replies

EEM Email setup for IP SLA

howithink
Level 1
Level 1

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

23 Replies 23

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,

Looks good to me.

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.....

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.

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

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?

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.

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

howithink
Level 1
Level 1

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.