Commit a Configuration Using an Event Policy
To commit a configuration on occurrence of an event, you can use the following configuration:
1
|
[edit]
|
2
|
user@host# show event-options
|
3
|
policy <policy-name> {
|
4
|
events <event-name>;
|
5
|
then {
|
6
|
change-configuration {
|
7
|
commands {
|
8
|
"set system login message hello";
|
9
|
}
|
10
|
}
|
11
|
}
|
12
|
}
|
13
|
|
14
|
[edit]
|
15
|
user@host#
|
As shown in the configuration, when a specified event occurs in the system, the policy gets executed and a configuration statement defined in policy is committed.
You can specify more that one configuration statement in a single policy.