cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1335
Views
0
Helpful
5
Replies

EEM with TCL Script

Arjun Dabol
Level 1
Level 1

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

2 Accepted Solutions

Accepted Solutions

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 ?

View solution in original post

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 ?

View solution in original post

5 Replies 5

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 ?

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

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.

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.

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 ?

Review Cisco Networking for a $25 gift card