Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

op

 

Syntax

Release Information

Command introduced in Junos OS Release 7.6.

Command introduced in Junos OS Release 9.0 for EX Series switches.

key option introduced in Junos OS Release 10.0.

url option introduced in Junos OS Release 10.0.

Description

Execute an op script. To execute local op scripts, you must configure the op script filename at the [edit system scripts op file] hierarchy level.

Op scripts can be stored in one of the following locations:

  • On the local device in the /var/db/scripts/op directory on the hard disk

  • On the local device in the /config/scripts/op directory on the flash drive.

    To execute op scripts from the flash drive, you must configure the load-scripts-from-flash statement at the [edit system scripts] hierarchy level.

  • At a remote URL

Op scripts are executed with the access privileges of the user who invokes the command to execute the script.

Note

If you include the op url command under the [edit event-options policy policy-name then execute-commands commands] hierarchy to execute a remote op script as an event policy action, Python scripts are executed using the access privileges of the generic, unprivileged user and group nobody. If you do not configure the user-name statement, SLAX and XSLT scripts are executed with root privileges.

Options

detail(Optional) Display detailed output.
argument-name argument-value(Optional) Specify one or more arguments to the script. For each argument you include on the command line, you must specify a corresponding value for the argument.
key (md5 | sha-256 | sha1) key-value(Optional) With the url option, specify a checksum hash to verify the integrity of the remote op script.

Starting in Junos OS Release 18.2R2 and 18.3R1, Junos OS supports only the SHA-256 hash function for script checksum hashes. Earlier releases support the MD5, SHA-1, and SHA-256 hash functions.

url url(Optional) Specify the URL for a remote script.
Note

Statements configured under the [edit system scripts op] hierarchy level are only enforced for op scripts that are local to the device. If you configure memory allocation, script dampening, traceoptions, or other op script-specific statements within that hierarchy, Junos OS does not apply the configuration when you execute a remote script using the op url command.

Additional Information

For more information about op scripts, see the Automation Scripting User Guide.

Required Privilege Level

maintenance

List of Sample Output

op

op url

Output Fields

When you enter this command, you are provided feedback on the status of your request.

Sample Output

op

user@host> op script1 interface ge-0/2/0.0 protocol inet

op url

user@host> op url https://www.example.net/opscripts/script1.slax key sha-256 150bf53383769f3bfedd41fe73320777f208d4fda81230cb27b8738 interface ge-0/2/0.0 protocol inet