cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1841
Views
0
Helpful
3
Replies

Cisco EEM : Test the SMTP functionality

I have configured EEM script on our routers for sending email when a BGP neighbor goes down on the router.

I would like to check/test if the router is able to send email or not when a BGP neighbor goes down, how can we test that the router I configured EEM script can send/reach email server

3 Replies 3

balaji.bandi
Hall of Fame
Hall of Fame

here is sample EEM

 

you can modify as per teh requirement

 

%BGP-5-ADJCHANGE: neighbor x.x.x.x Down BGP Notification sent
%BGP-5-ADJCHANGE: neighbor x.x.x.x Up

Configure terminal

event manager applet BGP
event syslog pattern “.*%BGP-5-ADJCHANGE:.*”
action 1.0 cli command “enable”
action 2.0 cli command “sh ip bgp nei | in BGP nei|BGP state|Desc”
action 3.0 mail server “mail.google.com” from “bgpfail@google.com.com” to “you@yourcompany.com” subject “Router BGP peer status down” body “$_cli_result”

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Thank you Balaji.

 

I configured the script. The problem is when BGP neighbor goes down we are not receiving the email from router but when BGP neighbor comes up we are receiving the email from Router. When i checked in the log i see following log for smtp at the time of neighbor down.

 

%HA_EM-3-FMPD_SMTP: Error occurred when sending mail to SMTP server: 10.3.8.24 : timeout error

 

10.3.8.24 is our smtp server. I can ping 10.3.8.24 from the Router.

 

%HA_EM-3-FMPD_SMTP: Error occurred when sending mail to SMTP server: 10.3.8.24 : timeout error

 

This could be reason, when the BGP down, you do not have routefor this IP ? in routing table ?

 

is this external IP ? check when BGP down, do you have reachability  to your SMTP Server ?

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help