Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Webcast-Catalyst9k
New Member

Cisco Switch TCL SMTP timeout

Hello I have some problem with cisco switch if i use SMTP event over TCL.

My TCl scrip contain code:

if [catch {smtp_send_email $mail_msg} result] {

error $result $errorInfo

#code for dump to file

} else {#code if all ok}

If internet is work script work fine. but if internet is down switch try send message long time and script "Process Forced Exit"

I have error

Jul 12 23:35:10: %HA_EM-6-LOG: event.tcl: Process Forced Exit- MAXRUN timer expired.
Jul 12 23:35:10: %HA_EM-6-LOG: event.tcl:     while executing
Jul 12 23:35:10: %HA_EM-6-LOG: event.tcl: "error $result $errorInfo"
Jul 12 23:35:10: %HA_EM-6-LOG: event.tcl:     invoked from within
Jul 12 23:35:10: %HA_EM-6-LOG: event.tcl: "$slave eval $Contents"
Jul 12 23:35:10: %HA_EM-6-LOG: event.tcl:     (procedure "eval_script" line 7)
Jul 12 23:35:10: %HA_EM-6-LOG: event.tcl:     invoked from within
Jul 12 23:35:10: %HA_EM-6-LOG: event.tcl: "eval_script slave $scriptname"
Jul 12 23:35:10: %HA_EM-6-LOG: event.tcl:     invoked from within
Jul 12 23:35:10: %HA_EM-6-LOG: event.tcl: "if {$security_level == 1} {       #untrusted script
Jul 12 23:35:10: %HA_EM-6-LOG: event.tcl:      interp create -safe slave
Jul 12 23:35:10: %HA_EM-6-LOG: event.tcl:      interp share {} stdin slave
Jul 12 23:35:10: %HA_EM-6-LOG: event.tcl:      interp share {} stdout slave
Jul 12 23:35:10: %HA_EM-6-LOG: event.tcl: ..."
Jul 12 23:35:10: %HA_EM-6-LOG: event.tcl:     (file "tmpsys:/lib/tcl/base.tcl" line 50)
Jul 12 23:35:10: %HA_EM-6-LOG: event.tcl: Tcl policy execute failed:
Jul 12 23:35:10: %HA_EM-6-LOG: event.tcl: Process Forced Exit- MAXRUN timer expired.

I try change Maxrun timer but it not help (i have same error but it not print before time not end).

I try ios for switch 150-2.SE4 | 122-55.SE8 | 122-44.6

I try this code on cisco router, it work fine(if smtp server not avalable script print error 1-2sec).

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Cisco Switch TCL SMTP timeout

No, that is not possible since the client socket connection is attempted synchronously.

5 REPLIES
Cisco Employee

Cisco Switch TCL SMTP timeout

If the mailer server is not listening on tcp/25 or otherwise refuses the connection, then the socket attempt should die quickly.  If the mail server is truly unreachable, then the socket will never timeout until the EEM policy terminates.  This holds true on the latest version of EEM on routers as well.

New Member

Cisco Switch TCL SMTP timeout

Thank you Joseph.

Possible skip in script line

if [catch {smtp_send_email $mail_msg} result] {}

if it run more 10sec?

New Member

Cisco Switch TCL SMTP timeout

I have lab test on router, I have same problem (like on switch) if SMTP server not available.

Cisco Employee

Cisco Switch TCL SMTP timeout

No, that is not possible since the client socket connection is attempted synchronously.

New Member

Cisco Switch TCL SMTP timeout

Thank you Joseph.

380
Views
0
Helpful
5
Replies
CreatePlease to create content