08-25-2015 12:50 AM
Hi,
I'm trying to write an EEM script in order to check the state of a track every 15 minutes and taking action accordingly.
My script looks like:
track 99 ip route 1.1.1.1 255.255.255.255 reachability
event manager applet test
event tag 1 timer watchdog time 900
event tag 2 track 99 state down
trigger
correlate event 1 and event 2
action 10 puts " track is down"
The script kicks in only once and then it stops. I need a liitle help from you in this.
Thank you.
08-25-2015 08:47 AM
You don't need to do this. The whole idea of tracking is that it's edge-triggered. The applet will kick off as soon as the tracked object changes state. All you need is:
event manager applet test
event track 99 state down
action 10 puts "track is down"
Polling in this case just adds overhead.
08-25-2015 08:57 AM
Thanks Joseph,
You're right, but I need to check the track state, periodically, and if the state is still down then I should see the message. I know this is possible, I did it once, long time ago.
08-25-2015 09:04 AM
This is not the correct approach to doing that. What you want to do is have the "down" applet install a new applet that does the watchdog. If that applet is allowed to run, assume the track is down. If the track comes up, make sure your "up" applet removes the installed watchdog applet.
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