Skip to content
Jessica Garrison edited this page Jul 8, 2024 · 24 revisions

ON-BOX SCRIPTING TYPES: COMMIT, OP, EVENT, AND SNMP

Commit Scripts

Commit scripts run when the candidate configuration is committed. Custom rules can be enforced using best practices and policies, then Junos OS can take the action required if the configuration does not pass the validation process.

  • Generate and display custom warning to the user
  • Generate and log custom system log (syslog) messages
  • Change the configuration to conform to your custom business rules
  • Generate a commit error and halt the commit operation

Op Scripts

Operation (op) scripts can be manually executed from the CLI or called by API or another script.

  • Create custom operational commands
  • Execute a series of operational mode commands
  • Shorten troubleshooting time by gathering operational information and iteratively narrowing down the cause of a network problem
  • Perform controlled configuration changes
  • Monitor the overall status of a device by creating a general operation script that periodically checks network warning parameters, such as high CPU usage.

Event Scripts

Events scripts are triggered by a defined event policy in response to a system event (ex. log). Event scripts usually perform an immediate action based on what the trigger was.

  • Automatically diagnose and fix problems in the network
  • Monitor the overall status of a device
  • Run automatically as part of an event policy that detects periodic error conditions
  • Change the configuration in response to a problem

SNMP Scripts

SNMP scripts allow custom MIB support for a MIB that is not supported in Junos OS. They are triggered when the SNMP manager requests information from the SNMP agent for an OID that is mapped to an SNMP script for an unsupported OID.

ON-BOX SUPPORTED SCRIPTING LANGUAGES: PYTHON, SLAX, AND XSLT

Python

What is Python on box?

Python scripts can be created and executed on Junos OS devices.

Getting Started with Python

Python Supported Release

  • >= Junos OS 16.1
  • All Junos OS Evolved

SLAX

What is SLAX?

SLAX is an alternate syntax for XSLT, that has a distinct syntax similar to C and Perl.

Getting Started with SLAX

SLAX Supported Releases

  • >= Junos OS 8.2
  • All Junos OS Evolved

XSLT

What is XSLT?

Extensible Stylesheet Language Transformations (XSLT) is the standard for processing Extensible Markup Language (XML) data.

Getting Started with XSLT

XSLT Supported Releases

  • >= Junos OS 8.2
  • All Junos OS Evolved