11-25-2016 08:21 AM
Hi Expert,
1. Does anyone here know how to place a tcl script in flash ? is it just like using copy tftp<filename> flash ?
2. also what below 2 commands will do once I keep my tcl script in flash ? how and when script will execute , lets say this script is to send BPDUGuard Trap to snmp server.
event manager directory user policy "flash:/USER_TCL"
event manager policy myscript.tcl type user
thanks
Solved! Go to Solution.
11-25-2016 08:58 AM
Hello,
not sure if your IOS supports the TCL shell:
Switch#tclsh
Switch(tcl)#copy
If it does, you can copy files to flash form various locations...
Is that what you are looking for ?
11-25-2016 11:34 PM
Hello,
here is what happens:
event manager directory user policy "flash:/USER_TCL"
--> your policies are stored in flash
event manager policy myscript.tcl type user
--> this tells EEM to run the script (myscript.tcl) from flash whenever the event defined in the policy occurs
So when the port is disabled due to bpduguard error, the snmp trap notification is sent.
By adding these two commands, you keep the actual policy out of the running configuration of your device, and instead invoke it from flash.
Does that clarify your question ?
11-25-2016 08:58 AM
Hello,
not sure if your IOS supports the TCL shell:
Switch#tclsh
Switch(tcl)#copy
If it does, you can copy files to flash form various locations...
Is that what you are looking for ?
11-25-2016 09:27 AM
hi, Thanks for your reply , i just edited my post.
My original doubt is below :
I want to understand what below 2 commands will do once I keep my tcl script in flash ? how and when script will execute , lets say this script is to send BPDUGuard Trap to snmp server.
event manager directory user policy "flash:/USER_TCL"
event manager policy myscript.tcl type user
11-25-2016 10:34 AM
Hello,
not sure what you are asking. The first command specifies the directory where the user policies are stored, the second line registers the user defined policy.
Nothing executes without a specific event defined in the policy itself.
11-25-2016 09:02 PM
that's exactly I wanted to understand.
these are the event details -
TCL script is written to send a trap notification when a port has been disabled due to a bpduguard error. and then configured with EEM.
now can you plz help me understand what will be the flow of events with above config.
11-25-2016 11:34 PM
Hello,
here is what happens:
event manager directory user policy "flash:/USER_TCL"
--> your policies are stored in flash
event manager policy myscript.tcl type user
--> this tells EEM to run the script (myscript.tcl) from flash whenever the event defined in the policy occurs
So when the port is disabled due to bpduguard error, the snmp trap notification is sent.
By adding these two commands, you keep the actual policy out of the running configuration of your device, and instead invoke it from flash.
Does that clarify your question ?
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