op
Syntax
op filename <detail> <argument-name argument-value> <key (md5 | sha-256 | sha1) key-value <url url>
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.
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 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 |
Additional Information
For more information about op scripts, see the Automation Scripting User Guide.
Required Privilege Level
maintenance
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
Release Information
Command introduced in Junos OS Release 7.6.
key
option introduced in Junos OS Release 10.0.
url
option introduced in Junos OS Release 10.0.