policy (Event Policy)
Syntax
policy policy-name { attributes-match { event1.attribute-name equals event2.attribute-name; event.attribute-name matches regular-expression; event1.attribute-name starts-with event2.attribute-name; } events [ events ]; then { ... the then subhierarchy appears at the end of the [edit event-options policy policy-name] hierarchy level ... } within seconds { events [ events ]; not events [ events ]; trigger (on | after | until) event-count; } then { change-configuration { commands { "command"; } commit-options { check <synchronize>; force; log "comment-string"; synchronize; } retry count number interval seconds; user-name username; } event-script filename { arguments { argument-name argument-value; } destination destination-name { retry-count count retry-interval seconds; transfer-delay seconds; } output-filename filename; output-format (text | xml); user-name username; } execute-commands { commands { "command"; } destination destination-name { retry-count count retry-interval seconds; transfer-delay seconds; } output-filename filename; output-format (text | xml); user-name username; } ignore; priority-override { facility facility-type; severity severity-level; } raise-trap; upload filename (filename | committed) destination destination-name { retry-count count retry-interval seconds; transfer-delay seconds; user-name username; } } }
Hierarchy Level
[edit event-options]
Description
Define an event policy to be processed by the eventd
process. If you configure a policy, the events
and then
statements are mandatory.
You can configure multiple policies to be processed for an event.
The policies are executed in the order in which they appear in the
configuration. If you configure more than one policy for an event,
and if one of the policies is configured to ignore the event, no policies
that follow the policy with the ignore
statement are executed.
Default
If you do not configure a policy for an event, no actions are taken upon receipt of the event, which is recorded in the system log.
Options
policy-name | Name of an event policy. |
The remaining statements are explained separately. See CLI Explorer.
Required Privilege Level
maintenance—To view or add this statement in the configuration.
Release Information
Statement introduced in Junos OS Release 7.5.