Cisco Support Community

EEM and syslog ext

I'm trying to get EEM to send an email using syslog extensions. The script works when run manually, but it never triggers from syslog.

Here is my syslog extension-

::cisco::eem::event_register_syslog occurs 1 pattern .*%SYS-5-CONFIG.* maxrun 90 queue_priority low nice 1

I have configured following this video-

I am running IOS 12.4(15)T7, but have tried others with the same results.

Any ideas? Thanks

Cisco Employee

Re: EEM and syslog ext

Leave out the %. Try:

::cisco::eem::event_register_syslog occurs 1 pattern "SYS-5-CONFIG.*" maxrun 90 queue_priority low nice 1

Re: EEM and syslog ext

Thanks for the tip Joe. It still does not work, I must have messed something up in the script. I'll go through it again and see what I can find. Thanks,

Re: EEM and syslog ext

Actually that did fix it! I had to remove the event manager policy sendmail.tcl and then add it again. Thanks again.

Community Member

Re: EEM and syslog ext

I've tried to implement this script on my router but came across the following error when the router tried sending the email:

021948: Dec 13 20:45:16.898: %HA_EM-6-LOG: sendmail.tcl: smtp_send_email: error connecting to mail server:

can't read "reply_code_str(": no such element in array

Obviously  the code in the parenthesis ( is what my email  server is returning to the router when it tries to connect. 

Can  someone advise on how I can overcome this issue or declare the system  message the email server will send to the router when it tries to  connect.  Here is an example of what the router gets when trying to connect: ESMTP Exim 4.69 #1 Tue, 13 Dec 2011 20:44:49 +0200

220-We do not authorize the use of this system to transport unsolicited,

220 and/or bulk e-mail.

Many thanks in advanced.


Cisco Employee

Re: EEM and syslog ext

Can you change the SMTP server to use a space instead of a '-' after the response code?  As you noted, your current banner is not supported by EEM.  The workaround would be to take the library code at tmpsys:/lib/tcl/smtp_lib.tcl, modify it to work with your SMTP server, modify the namespace from ::cisco::lib to something like ::customer::lib, change your code to use ::customer::lib::smtp_*, and then copy the modified smtp_lib.tcl back to your device as a user library file.

If you have more questions about this, please start a new thread.

Community Member

Re: EEM and syslog ext


Thank you so much for taking the time to reply.

I have opened a new thread as per request and kindly ask if you can help clarify a few questions, keeping in mind that I do not have a heavy programming background, and try to figure my way around using simple logic

Thank you!

CreatePlease to create content