cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1239
Views
20
Helpful
4
Replies

TCL: udp_open as policy

kasper123
Level 4
Level 4

I have a question regarding TCL and/or EEM.

A script with udp_open would execute when started manualy but if it is published as policy there are errors:

103894: *May 9 12:20:21.176 UTC: %HA_EM-6-LOG: time.tcl: (file "tmpsys:/lib/tcl/base.tcl" line 50)

103895: *May 9 12:20:21.176 UTC: %HA_EM-6-LOG: time.tcl: Tcl policy execute failed:

103896: *May 9 12:20:21.176 UTC: %HA_EM-6-LOG: time.tcl: invalid command name "udp_open"

103897: *May 9 12:20:22.123 UTC: %HA_EM-6-LOG: time.tcl: invalid command name "udp_open"

103898: *May 9 12:20:22.123 UTC: %HA_EM-6-LOG: time.tcl: while executing

103899: *May 9 12:20:22.123 UTC: %HA_EM-6-LOG: time.tcl: "udp_open"

106300: *May 9 12:20:22.123 UTC: %HA_EM-6-LOG: time.tcl: invoked from within

106301: *May 9 12:20:22.123 UTC: %HA_EM-6-LOG: time.tcl: "$slave eval $Contents"

106302: *May 9 12:20:22.123 UTC: %HA_EM-6-LOG: time.tcl: (procedure "eval_script" line 7)

106303: *May 9 12:20:22.123 UTC: %HA_EM-6-LOG: time.tcl: invoked from within

106304: *May 9 12:20:22.123 UTC: %HA_EM-6-LOG: time.tcl: "eval_script slave $scriptname"

106305: *May 9 12:20:22.123 UTC: %HA_EM-6-LOG: time.tcl: invoked from within

106306: *May 9 12:20:22.123 UTC: %HA_EM-6-LOG: time.tcl: "if {$security_level == 1} { #untrusted script

106307: *May 9 12:20:22.123 UTC: %HA_EM-6-LOG: time.tcl: interp create -safe slave

106308: *May 9 12:20:22.123 UTC: %HA_EM-6-LOG: time.tcl: interp share {} stdin slave

106309: *May 9 12:20:22.123 UTC: %HA_EM-6-LOG: time.tcl: interp share {} stdout slave

Does anyone have an idea what's wrong?

Thank you in advance for taking the time to respond.

4 Replies 4

Joe Clarke
Cisco Employee
Cisco Employee

EEM does not currently support UDP sockets.  I have filed CSCth34807 requesting support to be ported.

Hi Joseph,

in the bug details it says that there is a workaround for this:

Workaround:

Use an EEM policy to wrap the execution of a Tcl shell script which can then open UDP sockets

Do you know how do I do that?

Thanx again!

Write a tclsh policy that you invoke from EEM using (for example):

action 002 cli command "tclsh flash:/udp_script.tcl"

Thank you!

I will give that a try.

Regards.

Review Cisco Networking for a $25 gift card