cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1178
Views
0
Helpful
3
Replies

eem to tcl convert issue

Hi guys,

 

I need some help converting the bellow eem script to tcl script for a cisco catalyst 9300 switch without the addon license pack ( so i cannot run the eem script without first rebooting the switch which i cannot do)

I tried the eem to tcl converter from marcus but i admit i am a noob in tcl, i went in tclsh mode and copied in what the converter made from my eem script but i got an error :

namespace import ::cisco::eem::*
namespace import ::cisco::lib::*

array set arr_einfo [event_reqinfo]


if [catch {cli_open} result] {-----it errored on this cli_open part

here is the eem script i like to convert:
conf t
event manager applet noALLOWALL authorization bypass
event none maxrun 300
action 0001 cli command "enable"
action 0002 cli command "sh ip int br | i Giga"
action 0003 foreach line "$_cli_result" "\n"
action 0004 regexp "GigabitEthernet[0-9\/]+" "$line" match
action 0005 if $_regexp_result eq "1"
action 0006 cli command "conf t"
action 0007 cli command "int $match"
action 0008 cli command "no ip access-group ALLOW_ALL in"
action 0009 cli command "end"
action 0010 end
action 0011 end
end





hope someone can help out with this

best regards

Edwin

 

3 Replies 3

anyone?

To clarify better , i need to know how i can go from the above eem script to a workable tcl script for the switch, and how exactly i should execute it

 

 

 

this is the eem that i would like to convert to tcl:

conf t
event manager applet noALLOWALL authorization bypass
event none maxrun 300
action 0001 cli command "enable"
action 0002 cli command "sh ip int br | i Giga"
action 0003 foreach line "$_cli_result" "\n"
action 0004 regexp "GigabitEthernet[0-9\/]+" "$line" match
action 0005 if $_regexp_result eq "1"
action 0006 cli command "conf t"
action 0007 cli command "int $match"
action 0008 cli command "no ip access-group ALLOW_ALL in"
action 0009 cli command "end"
action 0010 end
action 0011 end
end

As i said i tried the converter marcus) but i do not understand how to use that on the switch..

Should i copy the converted content into a text and name it .tcl and then copy it to the flash in a directory or ..?

It would help me a great deal if i could figure this out with the community's help as i often find switches (9000 series) without the addon license and that effectively blocks me from using my EEM script unless i add the addon to the license but then the switch needs to be rebooted and since it is in operational status at customer i rather not do that unless i really have to

Hope someone can help here

 

Dan Frey
Cisco Employee
Cisco Employee

The marcus converter takes EEM applet and transposes to EEM/TCL.   EEM/TCL still relies on EEM libraries and would need the addon license you mentioned.   I believe you are looking to execute native TCL without EEM libraries which this link has useful info.

https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus9000/sw/93x/progammability/guide/b-cisco-nexus-9000-series-nx-os-programmability-guide-93x/b-cisco-nexus-9000-series-nx-os-programmability-guide-93x_chapter_0100111.html