Trigger an Event Policy Based on Event Count
You can configure an event policy to trigger if an event or set of events occurs a specified number of times within a given time period.
To execute an event policy based on event count, include the optional trigger
statement at the [edit event-options policy policy-name
within seconds] hierarchy level:
[edit event-options policy policy-name within seconds] trigger (after | on | until) event-count;
The software counts the number of times a trigger event occurs. A triggering event can be any
event configured at the [edit event-options policy
policy-name events] hierarchy level. You can
configure the following options:
after event-count—The policy is executed when the number of matching events received equalsevent-countplus one.on event-count—The policy is executed when the number of matching events received equalsevent-count.until event-count—The policy is executed each time a matching event is received and stops being executed when the number of matching events received equalsevent-count.
For example, consider the following policy with three trigger events. The within
120 and trigger on 3 statements instruct the device to
execute the policy as soon as 3 trigger events in any combination occur within 120
seconds. Thus, if a TRIGGER1 event, a TRIGGER2 event, and a TRIGGER3 event each occurs
in that time frame, the policy executes. Similarly, if the TRIGGER2 event occurs twice
and then a TRIGGER1 event occurs once in the time frame, the policy executes.
[edit event-options]
policy trigger-on-count {
events [ TRIGGER1 TRIGGER2 TRIGGER3 ];
within 120 {
trigger on 3;
}
then {
...
}
}
Consider the same event policy, but with trigger until 3. In this case,
the first and the second trigger events that occur within the time frame will each cause
the event policy to execute the policy's actions. If a third trigger event also occurs
within the specified time, the event policy does not execute any actions.
[edit event-options]
policy trigger-on-count {
events [ TRIGGER1 TRIGGER2 TRIGGER3 ];
within 120 {
trigger until 3;
}
then {
...
}
}