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)
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.
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.
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.
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.
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 .