04-18-2012 01:35 AM
Hello,
How to configure event manager so when interface Tunnel goes down the router will reload only on specific time, when the router clock is between 12 A.M and 16 A.M ?
If interface Tunnel is down and router clock is not between 12 and 16 A.M, it should not reload.
track 1 interface Tunnel0 line-protocol
delay down 180 up 30
event manager applet tunnel-down
event track 1 state down
action 1.0 cli command "enable"
action 2.0 reload"
thanks
04-18-2012 01:39 AM
Hi Eugen,
I think that you could specify the exact time of the reload : reload at 04:01.
And you can do another applet if the interface goes UP => reload cancel.
Dan
04-18-2012 02:36 AM
Hi,
Tha applet should run only when the router time is between 12 and 16 AM.
If Tunnel is down and it is 17 AM the applet should not run.
04-18-2012 03:36 AM
Hi Eugen ,
I think that event timer together with cron entry is the solution for you.
Dan
04-18-2012 06:55 AM
I think you want to use multiple events here:
event manager applet tunnel-down
event tag track track 1 state down
event tag timer timer cron cron-entry "* 12-16 * * *"
trigger
correlate event track and event timer
action 1.0 cli command "enable"
action 2.0 "reload"
04-18-2012 07:08 AM
in this case the applet will run every minute from 12 to 16 h.
If the action 2.0 is not the command reload, but some show commands, than every minute of the specific time range the applet will run.
The apllet should run only once, if for example, the time is 13 o'clock and Tunnel is down, than do some actions.
Thanks
04-18-2012 07:13 AM
The applet will only run if both the tunnel is down and the time is between 12 and 16. That's what the correlate does. Yes, if the tunnel is still down when the route reloads, it will reload again while the time window is still between 12 and 16. It will not necessarily run every minute, though.
04-18-2012 07:32 AM
what if I do not use reload but some show command, than every minute the show command will run.
04-18-2012 07:36 AM
The same is with "reload", after reload if the interface will be down and also the time range will be 12-16 , it will reload again.
Dan
04-18-2012 07:39 AM
No, it will not run every minute. The track down event is an edge-trigger event. It will only happen once when the tunnel goes down. The tunnel would need to come back up and go down again within the 12-16 window for the policy to run again.
04-18-2012 07:17 AM
Eugen ,
EEM action is triggered by 2 events in this case :
- time interval - because you want to take actions only between 12 and 16
- tunnel interface down.
After the applet is applying the actions it will stop, it will not run just once like a daemon, it is more like a script.
So there is the need to run every minute and check if the tunnel is down.
Please correct me if i'm wrong Joseph
Dan
04-18-2012 07:20 AM
Correct. These are edge-triggered events. Of course, as I said, if when the router reloads the tunnel is still down, the router will reload again (because the tunnel down event will still occur).
04-18-2012 07:51 AM
thank you, it was very helpful
04-18-2012 07:51 AM
thank you, it was very helpful
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: