cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1428
Views
0
Helpful
4
Replies

Track read and iterator variables

Tom Beecher
Level 1
Level 1

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?

1 Accepted Solution

Accepted Solutions

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.

View solution in original post

4 Replies 4

Joe Clarke
Cisco Employee
Cisco Employee

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.

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.

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.

Perfect. Thanks for that info!

Review Cisco Networking for a $25 gift card