cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1571
Views
15
Helpful
13
Replies

Event Manager time-range applet

Eugen Bitca
Level 1
Level 1

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

13 Replies 13

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

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.

Hi Eugen ,

I think that event timer together with cron entry is the solution for you.

Dan

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"

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

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.

what if I do not use reload but some show command, than every minute the show command will run.

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

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.

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

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).

thank you, it was very helpful

thank you, it was very helpful

Getting Started

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: