07-27-2017 10:00 PM
I find that I'm able to use "package require udp" in both the interactive TCL interpreter and in scripts that I keep in flash. For example:
router#tclsh
router(tcl)#package require udp
1.0
router(tcl)#
Using that same directive in an EEM policy script causes a problem:
router#more flash:/eem_policies/test.tcl
::cisco::eem::event_register_none
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
package require udp
router#event manager run test.tcl
can't find package udp
while executing
"package require udp"
invoked from within
"$slave eval $Contents"
(procedure "eval_script" line 7)
invoked from within
"eval_script slave $scriptname"
invoked from within
"if {$security_level == 1} { #untrusted script
interp create -safe slave
interp share {} stdin slave
interp share {} stdout slave
..."
(file "tmpsys:/lib/tcl/base.tcl" line 50)
Tcl policy execute failed: can't find package udp
router#
Can somebody clue me in on how I might use the UDP package from within a policy as opposed to a vanilla script?
Solved! Go to Solution.
07-30-2017 09:39 AM
You cannot. EEM Tcl does not support UDP. It has been requested, but thus far unimplemented.
07-30-2017 09:39 AM
You cannot. EEM Tcl does not support UDP. It has been requested, but thus far unimplemented.
07-31-2017 06:16 AM
Thanks very much, Joe!
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