Example: Generating Internal Events to Trigger Event Policies
The following two examples generate an internal event. In the first example, the configuration generates an internal event every hour. In the second example, the configuration generates an event every night at midnight.
In the following example, the internal event called EVERY-ONE-HOUR
is generated every hour (3600 seconds).
If 3601 seconds pass and the event has not been generated, certain
actions are taken.
[edit event-options]
generate-event {
every-one-hour time-interval 3600;
}
policy check-heartbeat {
events every-one-hour;
within 3601 not events every-one-hour;
then {
... actions ...
}
}
In the following example, the internal event called IT-IS-MIDNIGHT
is generated at 12:00 AM every night
(00:00:00). When the eventd process receives the IT-IS-MIDNIGHT
event, certain actions are taken.
[edit event-options]
generate-event {
it-is-midnight time-of-day 00:00:00;
}
policy midnight-chores {
events it-is-midnight;
then {
... actions ...
}
}