cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1112
Views
0
Helpful
3
Replies

track state checking every 15 minutes

iulian.dumbrava
Level 1
Level 1

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.

 

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

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.

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.

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.