Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Executing a Script on the Devices

You can execute op scripts on one or more devices simultaneously by using the Devices workspace in Junos Space Network Management Platform. Commit and event scripts are automatically activated after they are enabled. Commit scripts are triggered every time a commit is called on the device and event scripts are triggered every time an event occurs on the device or if a time is specified.

Note:

You can execute scrips on more than 200 devices only if the scripts do not require XPath processing. Scripts that do not require XPath processing include scripts without device-specific or entity-specific parameters and with /, //, or /device as context.

To execute a script on selected devices by using the Devices workspace:

  1. On the Junos Space Network Management Platform user interface, select Devices > Device Management.

    The Device Management page is displayed.

  2. Right-click the devices and select Device Operations > Execute Scripts.

    The Execute Scripts page displays the following scripts:

    • Scripts that are associated with and enabled (device scripts) on the selected devices

    • Scripts whose execution type matches your selection. If you selected multiple devices, only scripts whose EXECUTIONTYPE is set to GROUPEDEXECUTION are displayed. If you selected a single device, scripts whose EXECUTIONTYPE is set to SINGLEEXECUTION and GROUPEDEXECUTION are displayed.

    • Scripts whose context matches the device context

    Table 1 lists the columns on the Execute Scripts page and their descriptions.

    Table 1: Execute Scripts Page in the Devices Workspace

    Column

    Description

    Script Name

    Name of the script file

    Descriptive Name

    Descriptive name of the script

    Category

    Category of the script

    Description

    Description of the script

    Created Time

    Date and time when the script was created

    Last Updated Time

    Date and time when the script was last updated

  3. (Optional) To view the context:
    1. Click the View Context link.

      The Context dialog box is displayed.

    2. Click OK to close the dialog box.

  4. Select the script that you want to execute on the devices manually or by using tags.

    1. To select the script manually:

      1. Click the Select Manually option button.

        This option button is selected by default.

      2. Select the script.


    2. To select the script by using tags:

      1. Click the Select by tags option button.

      2. From the Select by tags drop-down list, select an appropriate tag.

      3. Click OK.

        The list of scripts is further filtered by the tag you selected.

      4. Select the script.

  5. (Optional) Click the Value column and enter the values for the parameters of the selected script.
  6. Select whether to execute the script now or schedule the execution for a later time:

    1. To execute the script on the devices now:

      1. Click Execute.

        The Script Results page appears. Table 2 lists the columns and their descriptions.

        Table 2: Script Results Page

        Column

        Description

        Job Id

        Job ID of the job triggered for executing the script

        Script Name

        Name of the script

        Device Name

        Name of the device as stored in the Junos Space Platform database

        If you are executing a device script that contains the EXECUTIONTYPE set to GROUPEDEXECUTION on multiple devices or physical interfaces of multiple devices, the Script Results page displays multiple rows listing the devices in this column.

        If you are executing a local script that contains the GROUPBYDEVICE annotation set to TRUE on multiple devices or physical interfaces of multiple devices, the Script Results page displays multiple rows listing the devices in this column.

        If you are executing a local script that does not contain the GROUPBYDEVICE annotation or the GROUPBYDEVICE annotation is set to FALSE on multiple devices or physical interfaces of multiple devices, this column displays the Devices hyperlink. Click the hyperlink to view the list of devices on which the script is executed.

        Node IP

        IP address of the Junos Space node to which the device is connected

        Node Name

        Name of the Junos Space node to which the device is connected

        Progress

        Progress of the job

        Status

        Completion status of the job: SUCCESS or FAILED

        The lower area of the Script Results page displays the results of the script execution. If you executed a local script that contains the GROUPBYDEVICE annotation set to TRUE on multiple devices, click the appropriate device in the Device Name column to view the results of the script execution on the device.

      2. (Optional) To view the list of devices on which the script was executed:

        1. Click the Devices hyperlink in the Device Name column.

          The Device Name List information dialog box is displayed with the list of devices.

        2. Click Ok to close the information dialog box.

      3. Click Close (at the bottom of the page).

        You are redirected to the Device Management page.


    2. To schedule the execution of the script on the devices for a later time:

      1. Select the Schedule at a later time check box.

      2. Enter the date in the Date field in the MM/DD/YYYY format.

      3. Enter the time in the Time field in the hh:mm format.

      4. Click Execute.

        The Job Information dialog box displays a link to the job ID. Click the Job ID link to view the status of this task on the Job Management page.

      5. Click OK to close the Job Information dialog box.

        You are redirected to the Device Management page.