cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1445
Views
0
Helpful
2
Replies

EEM policy script blows up at "package require"

chrismarget
Level 1
Level 1

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?

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

You cannot.  EEM Tcl does not support UDP.  It has been requested, but thus far unimplemented.

View solution in original post

2 Replies 2

Joe Clarke
Cisco Employee
Cisco Employee

You cannot.  EEM Tcl does not support UDP.  It has been requested, but thus far unimplemented.

Thanks very much, Joe!