Example: Associating an Optional User with an Event Policy Action
Configure two event policies, policy1
and policy2
.
In policy1
, associate user user1
with
the execute-commands
action. The execute-commands
action is executed with user1
privileges.
In policy2
, do not explicitly associate a
user with the event-script
action. The event-script
action is executed with root privileges.
[edit system] login { user user1 { class operator; } } [edit event-options] policy p1 { events e1; then { execute-commands { commands { "show version"; } user-name user1; output-filename command-output.txt; destination some-dest; } } } policy p2 { events e2; then { event-script script.xsl { output-filename event-script-output.txt; destination some-dest; } } }