10-03-2008 10:34 AM
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
10-03-2008 02:47 PM
Leave out the %. Try:
::cisco::eem::event_register_syslog occurs 1 pattern "SYS-5-CONFIG.*" maxrun 90 queue_priority low nice 1
10-06-2008 05:28 AM
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,
10-06-2008 05:30 AM
Actually that did fix it! I had to remove the event manager policy sendmail.tcl and then add it again. Thanks again.
12-13-2011 10:55 AM
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.
12-13-2011 11:17 AM
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.
12-13-2011 12:34 PM
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!
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