Commit Script Overview
Junos OS commit scripts enforce custom configuration rules. Each time a new candidate configuration is committed, the active commit scripts inspect the new candidate configuration. If a configuration violates your custom rules, the script can instruct the Junos OS to perform various actions, including the following:
- Make changes to the configuration
- Generate custom warning messages
- Generate custom system log (syslog) messages
- Generate custom error messages and stop the commit operation
Commit scripts are based on the Junos XML management protocol and the Junos XML API. The Junos XML management protocol is an XML based RPC mechanism, and the Junos XML API is an XML representation of Junos configuration statements and operational mode commands. Commit scripts can be written in either the Extensible Stylesheet Language Transformations (XSLT) or Stylesheet Language Alternative Syntax (SLAX) scripting language. Commit scripts use the XML Path Language (XPath) to locate the configuration objects to be inspected and XSLT or SLAX constructs to specify the actions to perform on the configuration objects. The actions can change the configuration or generate messages about it. For more information about XSLT, see XSLT Overview. For more information about SLAX, see SLAX Overview
Additionally, you can create macros, which allow you to create custom configuration syntax that simplifies the task of configuring a device running Junos OS. By itself, your custom syntax has no operational impact on the device. A corresponding commit script macro uses your custom syntax as input data for generating standard Junos configuration statements that execute your intended operational impact.
To view the device's current configuration in the Extensible Markup Language (XML), using the command-line interface's (CLI's) operational mode, issue the show configuration | display xml command. To view your configuration in commit-script-style XML, issue the show configuration | display commit-scripts view command.
Hide Navigation Pane
Show Navigation Pane
Download
SHA1