04-05-2016 11:20 AM
I currently have a set of SLA monitors grouped together in a track group, with associated EEM applets that bring interface up or down if that track group changes. That _should_ mean that the TG and interface should always be in the same state, however I am finding cases that's not true.
While I haven't yet run that down, I'm trying to put together a separate applet to sync those states up. (Also, to get some data on how frequently it's happening. :) ) I tried to do this:
action 100 set numbers "10 11 12 13"
action 110 foreach _iterator "$numbers"
action 120 track read $_iterator
action 1XX Stuff to change the state of the interface if they dont match, log, etc.
Problem is that the 'track read' comment does not allow you to use a variable. I've been unable to come up with an alternative solution other than one applet for each TG/loopback combo., and that feels kludgy.
Any solutions that I'm not seeing?
Solved! Go to Solution.
04-05-2016 02:05 PM
Ah, I misunderstood. You have two choices. Either use one applet per or convert your applet to Tcl using http://www.marcuscom.com/convert_applet and then you can use variables.
04-05-2016 01:50 PM
Take a look at https://supportforums.cisco.com/document/102581/eem-built-action-variables . The variable will be $_track_state after you call "track read". You can then set another variable to this value if you need to cache it outside of the loop.
04-05-2016 02:02 PM
Joe-
Thanks for the reply. Problem is I can't use a variable in track read :
cry2.spe(config)#event manager applet TESTING authorization bypass
cry2.spe(config-applet)#event none
cry2.spe(config-applet)#action 100 set numbers "10 11 12 13"
cry2.spe(config-applet)#action 110 foreach _iterator "$numbers"
cry2.spe(config-applet)#action 120 track read $_iterator
^
% Invalid input detected at '^' marker.
cry2.spe(config-applet)#
Might be a bad copypasta there, but the ^ is under the $ .
cry2.spe(config-applet)#action 120 track read ?
<1-1000> Tracking object number
cry2.spe(config-applet)#
Not sure if it's a version thing here ; This is 15.3(3)S1 on an ASR1006.
04-05-2016 02:05 PM
Ah, I misunderstood. You have two choices. Either use one applet per or convert your applet to Tcl using http://www.marcuscom.com/convert_applet and then you can use variables.
04-05-2016 02:10 PM
Perfect. Thanks for that 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