Blogs

Scripting How-To: Commit a configuration using an event policy

By Erdem posted 08-10-2015 20:45

  

To commit a configuration on occurrence of an event, the following configuration can be used:

 

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 per the above configuration, when a specified event occurs in the system, this policy get executed and a configuration statement defined in policy will be committed. A user can specify more that one configuration statement in a single policy.


#eventpolicy
#ScriptingHow-To
#commitscript
#How-To