09-29-2022 12:42 AM
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
09-30-2022 06:00 AM
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
10-01-2022 01:47 AM
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
10-01-2022 12:18 PM
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.
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