04-04-2019 03:58 AM
Hi I'm wondering if a .tcl file would be run automatically each time a tracking state for an IP SLA (icmp-echo) changes from/to up/down? Based on some research, something like (I can't test if this works because Tcl/EEM doesn't work properly with routers in GNS3)
E.g.
event manager applet test event track 1 state up action 1.0 cli command "enable" action 1.1 cli command "tclsh flash:/1.tcl" event track 1 state down action 1.0 cli command "enable" action 1.1 cli command "tclsh flash:/2.tcl"
Also, I think another option would be using ::cisco::eem::event_register with tracking and event_reqinfo but I'm not sure how I would pull the track state information to be used in a if else statement. This would also mean the one script. Thanks for any assistance.
Solved! Go to Solution.
04-04-2019 09:46 AM
Yes, it will, but this approach is not recommended. Combining EEM and tclsh in this manner will just burn resources. You could likely do everything you want in EEM itself.
04-04-2019 04:37 AM - edited 04-04-2019 04:38 AM
Since we are not sure inside the content of TCL, why not run same task with EEM, rather adding another complexity.
until you have reason ? please show us the tcl action and explain more to understand your use case.
reference :
04-04-2019 05:24 AM
04-04-2019 09:46 AM
Yes, it will, but this approach is not recommended. Combining EEM and tclsh in this manner will just burn resources. You could likely do everything you want in EEM itself.
04-04-2019 04:37 PM
04-05-2019 06:38 AM
Correct, you can't do that in an applet, but you can do it with EEM+Tcl. Meaning, convert your applet to Tcl using https://www.marcuscom.com/convert_applet/ and then fold in your tclsh code into that. Then you are only using one subsystem to execute your automation.
04-05-2019 04:57 PM
Great tool, thanks for that. What would happen my device doesn't support the namespace import lines though?
04-06-2019 12:42 AM
Other option to move to next version which support or accept the limitation and make arrangement as per the available options.
or do the task out of the box.
04-08-2019 06:27 AM
All versions of IOS that support EEM+Tcl support those namespaces. Make sure you're registering the EEM+Tcl scripts as user policies following https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/eem/configuration/15-mt/eem-15-mt-book/eem-policy-tcl.html#GUID-4EA20060-0678-4652-BD64-C10D9FC0DFBB .
04-10-2019 01:12 AM
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