Executing Junos Scripts

To execute an operation script, follow these steps:

  1. In the Junos Scope main window, click Configuration > Repository > Scripts. The Scripts dialog box appears.
    Image s001521.gif

    All scripts saved in the Junos Scope CVS repository are listed in the Scripts dialog box alphabetically by name. The dialog box displays the script filename, type, and the actions you can perform on scripts.

  2. Click the Execute link of the script that you want to execute. The Select Script Revision and Options dialog box appears.
    Image s001518.gif
  3. Select the script revision that you want to execute.
  4. Specify the parameters for the script execution by providing the parameter name and value and clicking Add. The parameters are displayed in List of Parameters for script execution. You can delete a parameter by selecting the parameter and clicking Remove.
  5. Select the pattern type (success or failure) from the list and enter a pattern value in the field. After the script executes successfully, Junos Scope searches for this value in the output of the script execution and displays the status message in the Status page (Monitor > Status > View Status Records).
    • Success pattern — If you select this option from the list, Junos Scope displays a “success” message in the Status page if the value is found in the output of the script execution and a “failure” message if the value is not found in the output.
    • Failure pattern — If you select this option from the list, Junos Scope displays a “failure” message in the Status page if the value is found in the output of the script execution and a “success” message if the value is not found in the output.
  6. Select the device or group of devices on which you want to execute the script, from the Group or Select Devices list box. Shift-click to select multiple devices from the Select Device(s) drop-down list box.
  7. Select when you want to execute the script:
    • Now— (Default) Performs the execute operation immediately after you confirm it.
    • Save Operation as—Select to save the script execution operation and run it at a later time. Click Save Operation as, then type an operation name in the text box.
    • Select Schedule—Performs the script execution operation at the scheduled time interval. Select the schedule that you want in the schedule table.
  8. Click Next. The Confirm Selection dialog box appears.
    Image s001519.gif
  9. Confirm that the selections you made are correct and click Finish to execute the script. Click Previous to return to Specify Devices and Time dialog box.
    • If you selected Now in Step 7, the execute operation occurs immediately and the View Status Records dialog box appears.

      The View Status Records dialog box lists the execute operation status by Operation name, Operation Type, Device Name, Report Name, User, Status, Start time, Last Updated Time, and Message.

      Image s001489.gif
    • If you selected Save Operation as, to save the execute operation, you return to the Configuration > Repository > Scripts menu. To view the saved operation, click Settings > Saved Operations.
    • If you selected the Select Schedule option and selected a schedule, the script is executed when the operation is scheduled to be run.

    The status page (Monitor > Status > View Status Record) will change. The executed operation script will have a new link View Output displayed under the Action column. Click View Output to view the results of the operation script execution.