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.
system {
login {
user user1 {
class operator;
}
}
}
event-options {
policy policy1 {
events e1;
then {
execute-commands {
commands {
"show version";
}
user-name user1;
output-filename command-output.txt;
destination some-dest;
}
}
}
policy policy2 {
events e2;
then {
event-script script.xsl {
output-filename event-script-output.txt;
destination some-dest;
}
}
}
}