[an error occurred while processing this directive][an error occurred while processing this directive]

Executing an Op Script from a Remote Site

As an alternative to storing operation (op) scripts locally on the router or switch, you can store op scripts at a remote site. This enables 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 router or switch, and run the script through one or more hash functions to calculate hash values.

    JUNOS 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 recalculates the checksum value using the configured hash and verifies that the calculated value matches the configured value.

Published: 2010-03-30

[an error occurred while processing this directive]