05-19-2020 04:42 PM
I am completely new to EEM and scripting. My goal is to send an email to our support when someone shuts or no shuts a DMVPN tunnel. If there is a way to send an SMS too/instead, even better. No 3G or 4G modem is in this router.
The interface is Tunnel200
We are using Office365 as our mail server.
Here was my failing attempt:
event manager environment _email_server support:Cisco$1@mail.pse.com
event manager environment _email_to me@pse.com
event manager environment _email_from support@pse.com
event manager applet Email_Tunnel_Status_Changed
event syslog pattern %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel200, changed state to up
action 1.0 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "PSE Customer tunner for $_info_routername is UP" body "$_info_routername" at "$_event_pub_time:" Changed the state of the DMVPN tunnel to PSE to UP
action 1.1 syslog msg "PSE Tunnel in UP state and E-mail was sent"
action 2 else
event syslog pattern %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel200, changed state to down
action 3.0 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "PSE Customer tunner for $_info_routername is DOWN" body "$_info_routername" at "$_event_pub_time:" Changed the state of the DMVPN tunnel to PSE to DOWN
action 3.1 syslog msg "PSE Tunnel in DOWN state and E-mail was sent"
action 4.0 exit
05-19-2020 04:53 PM
Lets do step by step
check is the EEM Script running before you sending email adding it, later SMS too
Are you able to see Syslog message as per the script in the syslog you see
action 1.1 syslog msg "PSE Tunnel in UP state and E-mail was sent"
action 3.1 syslog msg "PSE Tunnel in DOWN state and E-mail was sent"
if this is working, i see you do not have email server variable to send emails from server for your case office365, is this reachable on this device ?
Most of the provider offers (some i know and tested before you can send XXXXX@provider.com using your email server) - XXXX mobile bnumber.
05-19-2020 07:00 PM
No, this errors out when entered into the router:
event syslog pattern %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel200, changed state to up
05-20-2020 11:54 AM
Looks your EEM Applet not loaded correctly
Can you post output of below :
sh event manager policy registered
show run | begin event
06-21-2020 12:47 AM
Hi
try with quotation marks around the pattern
event syslog pattern "%LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel200, changed state to up"
06-19-2020 05:22 PM
Do you have another router on the network that have a way to send SMS?
If yes, I may have a solution for this problem.
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