Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
 

Related Documentation

 

Executing an Op Script from a Remote Site

As an alternative to storing operation (op) scripts locally on the device, you can store op scripts at a remote site. This allows you to execute the scripts by specifying a URL on the command line.

To execute an op script from a remote site:

  1. Create the script.
  2. (Optional) Store the script temporarily in the /var/tmp directory on the device, and run the script through one or more hash functions to calculate hash values.

    Junos OS supports MD5, SHA-1, and SHA-256 hash functions.

    user@host> file checksum md5 /var/tmp/script1.slax
    MD5 (/var/tmp/script1.slax) = 3af7884eb56e2d4489c2e49b26a39a97
    user@host> file checksum sha1 /var/tmp/script1.slax
    SHA1 (/var/tmp/script1.slax) = 00dc690fb08fb049577d012486c9a6dad34212c0
    user@host> file checksum sha-256 /var/tmp/script1.slax
    SHA256 (/var/tmp/script1.slax) = 150bf53383769f3bfedd41fe73320777f208d4fda81230cb27b8738
  3. Place the script on the remote server.
  4. Provide the script URL and the optional hash values to the administrators who will execute the script.
  5. Execute the script by running the op command and specifying the URL that points to the remote file.
    user@host> op url https://www.juniper.net/scripts/2009-04-01.01.slax
    key md5 3af7884eb56e2d4489c2e49b26a39a97

    This example shows how to include the <key> option and the MD5 checksum information.

Note: If the op script is stored locally, do not include the hash key on the command line. Instead, configure the hash value by including the checksum statement at the [edit system scripts op file filename] hierarchy level. During the execution of the script, Junos OS recalculates the checksum value using the configured hash and verifies that the calculated value matches the configured value.

To prevent the execution of op scripts from remote sites, configure the no-allow-url statement at the [edit system scripts op] hierarchy level.

user@host# set system scripts op no-allow-url

When you configure the no-allow-url statement, issuing the op url url operational mode command generates an error.

 

Related Documentation

 

Published: 2013-03-05

 

Related Documentation

 

Published: 2013-03-05