[c-nsp] Event manager mail

Mihyar Baroudi mbaroudi at progrizon.com
Sun Apr 17 18:37:01 EDT 2011


You can generate Event Manager Tcl scripts using Progrizon's Policy Builder at:

http://progrizon.com/support/pb/pb.php

Here is the Tcl code to send an email from an EEM script:

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

    set email_message "Mailservername: username:password at domain.com
    From: from_name at domain.com
    To: to_name at domain.com
    Cc: cc_name at domain.com
    Subject: Email Subject

    This is the email body"

    if {[catch {smtp_send_email $email_message} result]} {
        puts stderr $result
    }


-Mihyar Baroudi

------------------------------

Message: 3
Date: Sun, 17 Apr 2011 09:55:31 +0300
From: Ziv Leyes <zivl at gilat.net>
To: "cisco-nsp at puck.nether.net" <cisco-nsp at puck.nether.net>
Subject: Re: [c-nsp] Event manager mail
Message-ID:
	<EC993E87D960A541A66BF21D62AA42A632F85A3576 at exch2k7.gilat.local>
Content-Type: text/plain; charset="us-ascii"

I was about to answer you the same, about the bug.
Do you care to share the tcl script with us?
Ziv


-----Original Message-----
From: cisco-nsp-bounces at puck.nether.net [mailto:cisco-nsp-bounces at puck.nether.net] On Behalf Of Jan Gregor
Sent: Thursday, April 14, 2011 4:48 PM
To: cisco-nsp at puck.nether.net
Subject: Re: [c-nsp] Event manager mail

Hello,

just letting all know, this is a known bug CSCsl53037 which is AFAIK not fixed in 12.4 train. I have fixed this  with an Tcl script
doing the same thing, only correctly.

Best regards,

Jan

On 04/14/2011 10:07 AM, Jan Gregor wrote:
> Hi guys,
> 
> I have stumbled across weird error when configuring mail notification 
> from Event Manager of IOS router. The mail server parses the email and 
> tags it as malformed with this error:
> X-Amavis-Alert: BAD HEADER SECTION MIME error: error: unexpected end 
> of header
> 
> And indeed, when I check the message in quarantine, there is no MIME 
> header there at all.
> 
> The IOS version is c1841-advipservicesk9-mz.124-13.bin (yeah, I know 
> it is old) and configuration is this:
> 
> event manager applet email_configured
>  event syslog pattern ".*%SYS-5-CONFIG_I.*"
>  action 1.0 info type routername
>  action 3.0 mail server "$_email_server" to "you at dont.need" from 
> "to at know.this" subject "test $_syslog_msg" body "$_syslog_msg"
> 
> Any ideas how to fix this?
> 
> Best regards,
> 
> Jan



More information about the cisco-nsp mailing list