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.
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:
- On the Junos Space Network Management Platform user interface,
select Devices > Device Management.
The Device Management page is displayed.
- 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
- (Optional) To view the context:
Click the View Context link.
The Context dialog box is displayed.
Click OK to close the dialog box.
Select the script that you want to execute on the devices manually or by using tags.
To select the script manually:
- Click the Select Manually option button.
This option button is selected by default.
- Select the script.
- Click the Select Manually option button.
To select the script by using tags:
- Click the Select by tags option button.
- From the Select by tags drop-down list, select an appropriate tag.
- Click OK.
The list of scripts is further filtered by the tag you selected.
- Select the script.
- (Optional) Click the Value column and enter the values for the parameters of the selected script.
Select whether to execute the script now or schedule the execution for a later time:
To execute the script on the devices now:
- 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.
- (Optional) To view the list of devices on which the script
was executed:
- Click the Devices hyperlink in the Device Name
column.
The Device Name List information dialog box is displayed with the list of devices.
- Click Ok to close the information dialog box.
- Click the Devices hyperlink in the Device Name
column.
- Click Close (at the bottom of the page).
You are redirected to the Device Management page.
- Click Execute.
To schedule the execution of the script on the devices for a later time:
- Select the Schedule at a later time check box.
- Enter the date in the Date field in the MM/DD/YYYY format.
- Enter the time in the Time field in the hh:mm format.
- 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.
- Click OK to close the Job Information dialog
box.
You are redirected to the Device Management page.