cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1619
Views
3
Helpful
6
Replies

EEM and syslog ext

Collin Clark
VIP Alumni
VIP Alumni

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-

http://www.cisco.com/cdc_content_elements/flash/ios/ios_commercial/send_email/Send_Email.html

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

Any ideas? Thanks

6 Replies 6

Joe Clarke
Cisco Employee
Cisco Employee

Leave out the %. Try:

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

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,

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

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(220-gateway.firewall.cx)": no such element in array

Obviously  the code in the parenthesis (220-gateway.firewall.cx) 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:

220-gateway.firewall.cx 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.

Chris.

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.

Joseph,

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!

https://supportforums.cisco.com/thread/2120970