Contents
Scripts
A script is a sequence of commands and instructions used to configure CPE devices. Each script changes one or more device settings.
You can add scripts that are run automatically or manually to the CPE template. In both cases, the scripts are run by
. Please note that before adding and running scripts on a device, you must configure a VNFM connection to the device's console.Scripts run automatically if conditions specified in script settings are met. For example, a script can be automatically run whenever a CPE device is registered.
Configuring a VNFM connection to the console of a CPE device
The VNFM is responsible for running scripts on the CPE device. In the CPE template, you must specify the username and password, as well as the SSH port number, to let VNFM connect to the device console and run scripts. The specified connection settings apply to all devices that use the template. The connection only has to be configured once, except for cases when you need to use a different user on the CPE device or change the SSH port number.
To configure the settings for connecting the VNFM to the CPE device console:
- In the menu, go to the SD-WAN → CPE templates subsection.
A table of CPE templates is displayed.
- Click the CPE template.
The settings area is displayed in the lower part of the page. You can expand the settings area to fill the entire page by clicking the expand button
.
- Select the Scripts tab.
The tab displays settings for connecting the VNFM to the CPE device console, as well as a table of scripts, if at least one script is added.
- In the Default login field, enter the user name for authenticating the VNFM in the console of the device. Maximum length: 255 characters.
- In the SSH port field, enter the port number for connecting the VNFM to the CPE device console. The default setting is
1
. - In the Default password field, enter the password for authenticating the VNFM in the console of the CPE device. Maximum length: 255 characters. To see the entered password, you can click the show button
.
- In the upper part of the settings area, click Save to save the configuration of the CPE template.
Adding a script
You only add a script to the CPE template. When you add a script, it is added to all devices that use the template. Before adding a script, you must configure a VNFM connection to the CPE device console.
To add a script:
- In the menu, go to the SD-WAN → CPE templates subsection.
A table of CPE templates is displayed.
- Click the CPE template.
The settings area is displayed in the lower part of the page. You can expand the settings area to fill the entire page by clicking the expand button
.
- Select the Scripts tab.
The tab displays settings for connecting the VNFM to the CPE device console, as well as a table of scripts, if at least one script is added.
- Click + Script.
- This opens a window; in that window, in the Name field, enter the name of the script. Maximum length: 255 characters.
- In the Timeout (sec.) field, enter the time in seconds after which the VNFM stops attempting to run a script that could not run the first time. The default setting is
360
. - In the Executor drop-down list, select one of the following values:
- Ansible (selected by default)
- Shell
- Expect
- Custom to use your own interpreter in the VNFM
- If in the Executor drop-down list, you selected Custom, in the Custom executor field, enter the path to the interpreter.
- In the Stage drop-down list, select the stage in the operation of the CPE device at which you want to run the script:
- Registration (selected by default)
- Deletion
- Manually to run the script only manually
- If you want to allow running the script again, select the Repeat execution check box. This check box is cleared by default.
- In the Script field, enter the path to the script file or to the Ansible playbook script file.
- If necessary, in the File field, enter the path to additional files that the script needs to run. Supported formats of archives with files: TAR.GZ and ZIP.
- Click Save.
The script is added to the CPE template and displayed in the table.
Page topEditing a script
You can only edit a script in the CPE template. When you edit a script, it is edited on all devices that use the template.
To edit a script:
- In the menu, go to the SD-WAN → CPE templates subsection.
A table of CPE templates is displayed.
- Click the CPE template.
The settings area is displayed in the lower part of the page. You can expand the settings area to fill the entire page by clicking the expand button
.
- Select the Scripts tab.
The tab displays settings for connecting the VNFM to the CPE device console, as well as a table of scripts, if at least one script is added.
- Click Edit next to the script.
- This opens a window; in that window, edit the settings that you want to change. For a description of the settings, see the instructions for adding a script.
- Click Save.
Viewing the contents of a script
You can view the contents of the script on an individual device or in the CPE template.
To view the contents of a script on an individual CPE device:
- In the menu, go to the SD-WAN section.
By default, the CPE subsection is displayed with a table of CPE devices.
- Click the CPE device.
The settings area is displayed in the lower part of the page. You can expand the settings area to fill the entire page by clicking the expand button
.
- Select the Scripts tab.
A table of scripts is displayed if at least one script has been added.
- Click View next to the script.
This opens a window with the contents of the script.
To view the contents of a script in a CPE template:
- In the menu, go to the SD-WAN → CPE templates subsection.
A table of CPE templates is displayed.
- Click the CPE template.
The settings area is displayed in the lower part of the page. You can expand the settings area to fill the entire page by clicking the expand button
.
- Select the Scripts tab.
The tab displays settings for connecting the VNFM to the CPE device console, as well as a table of scripts, if at least one script is added.
- Click View next to the script.
This opens a window with the contents of the script.
Page topDeleting a script
You can only delete a script in the CPE template. When you delete a script, it is deleted on all devices that use the template. Deleted scripts cannot be restored.
To delete a script:
- In the menu, go to the SD-WAN → CPE templates subsection.
A table of CPE templates is displayed.
- Click the CPE template.
The settings area is displayed in the lower part of the page. You can expand the settings area to fill the entire page by clicking the expand button
.
- Select the Scripts tab.
The tab displays settings for connecting the VNFM to the CPE device console, as well as a table of scripts, if at least one script is added.
- Click Delete next to the script.
The script is deleted and is no longer displayed in the table.
- Click Apply.
Configuring the script run order
The script run order comes into play when multiple scripts must run at the same time on a CPE device; the run order determines which script runs first.
For example, you can add two scripts, each of which runs automatically when the device is registered. By default, the script that was added before the others runs first.
You can customize the run order in the CPE template. The run order specified in the template applies to all devices that use the template.
To configure scripts run order:
- In the menu, go to the SD-WAN → CPE templates subsection.
A table of CPE templates is displayed.
- Click the CPE template.
The settings area is displayed in the lower part of the page. You can expand the settings area to fill the entire page by clicking the expand button
.
- Select the Scripts tab.
The tab displays settings for connecting the VNFM to the CPE device console, as well as a table of scripts, if at least one script is added.
- To configure the script run order, click Up or Down next to each script. The topmost script in the settings area runs first.
- Click Apply.
Manually running scripts
You can run a script on an individual CPE device or on all devices that use the CPE template. To run a script manually, use the following instructions:
- Manually running a script on a CPE device.
- Running a script on all devices that use the CPE template.
If necessary, you can run all scripts added on an individual device or in a CPE template at the same time. To run all scripts, use the following instructions:
Page topDelayed scripts
The scheduler creates delayed tasks that allow running scripts on CPE devices at a specified time. When creating a delayed task, you must select a CPE template, scripts, and devices on which you want to run the scripts. You can run scripts on all devices that use the CPE template, or restrict the number of devices by manually selecting them or specifying certain tags.
For delayed running of scripts, use the following instructions:
- Delayed running a script on all devices that use the CPE template.
- Delayed running of scripts on devices with specific tags that use the CPE template.
- Delayed running a script on individual devices that use the CPE template.