Op Script Programming Overview

Junos OS operation (op) scripts automate network and device management and troubleshooting. Op scripts can perform any function available through the remote procedure calls (RPCs) supported by either the Junos XML management protocol or the Junos Extensible Markup Language (XML) API. Op scripts are executed by the Junos OS management (mgd) process.

Op scripts enable you to do the following things:

Op scripts are based on the Junos XML management protocol, and the Junos XML API, which are discussed in Junos XML Management Protocol and Junos XML API Overview. Op scripts can be written in either the Extensible Stylesheet Language Transformations (XSLT) or Stylesheet Language Alternative Syntax (SLAX) scripting language. Op scripts use XPath to locate the operational objects to be inspected and XSLT constructs to specify the actions to perform on the located operational objects. The actions can change the output or execute additional commands based on the output. For more information about XPath and XSLT, see XPath Overview and XSLT Overview. For more information about SLAX, see SLAX Overview.