cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1451
Views
5
Helpful
6
Replies

EEM ACTION MAIL DOES NOT WORK

I can not do eem send an email to me, sends syslog, mail bit, I can not, my configuration is this:

event manager applet VPN
event track 2 state down
action 1.0 mail server "myusername@yahoo.com.br:mypassword@smtp.mail.yahoo.com.br"
to "username@yahoo.com.br" from "username2@yahoo.com.br" cc "usernam3@hotmail.com" subject "vpn Dow" body "link VNP is Dow"
action 1.2 syslog priority critical msg "vpn dow"

my version is 124-9.T5

Could anyone help me please?

2 Accepted Solutions

Accepted Solutions

yjdabear
VIP Alumni
VIP Alumni

If this IOS<->EEM version-mapping is accurate, you have EEM 2.2, which doesn't support authenticated SMTP yet. According to one of the comments in this blog, you need at least EEM 2.4 to get that feature. Assuming everything else (such as ED) of your applet works, you'd need to upgrade the IOS to 12.4(20)T or later. Besides, I'm not sure the email function is supposed to work the way you're doing by directly specifying the environment variables such as "_email_server" in the applet itself.

View solution in original post

Yes, you're right.  SMTP authentication was added in EEM 2.4 (12.4(20)T), and 12.4(9)T only has EEM 2.2.  The other problem is that you cannot have a '@' in your username.  There is a bug in EEM applets where the '@' is not supported.  After upgrading to EEM 2.4, you will need to convert the applet to Tcl to support a username with '@'.

View solution in original post

6 Replies 6

yjdabear
VIP Alumni
VIP Alumni

If this IOS<->EEM version-mapping is accurate, you have EEM 2.2, which doesn't support authenticated SMTP yet. According to one of the comments in this blog, you need at least EEM 2.4 to get that feature. Assuming everything else (such as ED) of your applet works, you'd need to upgrade the IOS to 12.4(20)T or later. Besides, I'm not sure the email function is supposed to work the way you're doing by directly specifying the environment variables such as "_email_server" in the applet itself.

Yes, you're right.  SMTP authentication was added in EEM 2.4 (12.4(20)T), and 12.4(9)T only has EEM 2.2.  The other problem is that you cannot have a '@' in your username.  There is a bug in EEM applets where the '@' is not supported.  After upgrading to EEM 2.4, you will need to convert the applet to Tcl to support a username with '@'.

I got it, I have to upgrade my IOS to 12.4 (20) T or later, but anyway I would have to convert to tcl and I do not know how to do this conversion. And if I upgrade to IOS 15.1.3T the "@" would be supported?

Thanks

No, support for '@' in usernames has not been added to applets yet.

I wonder if anyone knows if my tcl script is wrong because it does not operate properly.

::cisco::eem::event_register_track 123 state down

namespace import ::cisco::eem::*
namespace import ::cisco::lib::*

set mail_pre "Mailservername: myusername@providerDomain:mypassword@providerSMTP\n"
append mail_pre "From: myusername@providerdomain\n"
append mail_pre "To: myusername2@providerDomain2\n"
append mail_pre "Cc: myusername3@princesaonline.com.br\n"
append mail_pre "Subject: Check VPN_Icarai\n\n"
append mail_pre "Please check VPN Icarai, something not working properly\n\n"
set mail_msg [uplevel #0 [list subst -nobackslashes -nocommands $mail_pre]]
if [catch {smtp_send_email $mail_msg} result] {
    error $result $errorInfo
}

Logs

*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl: usage: From:
*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl: wrong 2nd line format.
*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl: Tcl policy execute failed:
*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl:     (file "tmpsys:/lib/tcl/base.tcl" line 50)
*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl: ..."
*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl:      interp share {} stdout slave
*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl:      interp share {} stdin slave
*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl:      interp create -safe slave
*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl: "if {$security_level == 1} {       #untrusted script
*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl:     invoked from within
*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl: "eval_script slave $scriptname"
*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl:     invoked from within
*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl:     (procedure "eval_script" line 7)
*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl: "$slave eval $Contents"
*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl:     invoked from within
*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl: "smtp_send_email $mail_msg"
*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl:     while executing
*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl: usage: From:
*Jan 11 18:33:15.314: %HA_EM-6-LOG: applet-VPN.tcl: wrong 2nd line format.

My ios version is 124-24.T1

The line as it's written here is fine.  Make sure your actual line has a space between "From:" and the address, and there are no other spaces on the line.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: