Kaspersky SD-WAN

Additional configuration of CPE devices using scripts

You can use scripts for additional configuration of CPE devices. You can add scripts to a CPE template. Scripts added to the CPE template are automatically added to all CPE devices that use this CPE template. Added scripts can be run automatically or manually. Scripts are run automatically when the conditions specified in the script settings are satisfied, for example, when a CPE device is registered.

Running scripts is the responsibility of VNFM, so network connectivity between VNFM and CPE devices must be ensured before you begin working with scripts. By default, the port number for connecting the VNFM to the device and the user name for running scripts are specified in the CPE template. You can change the port number and user name if necessary.

The table of scripts is displayed in the CPE template and on the CPE device:

  • To display the table of scripts in a CPE template, go to the SD-WAN → CPE templates menu section, click the CPE template, and select the Scripts tab.
  • To display the table of scripts on a CPE device, go to the SD-WAN → CPE menu section, click the CPE device, and select the Scripts tab.

Information about scripts is displayed in the following columns of the table:

  • Name is the script name.
  • Executor is the interpreter.
  • Authentication is the type of VNFM authentication in the CPE device.
  • Custom executor is the path to the custom interpreter.
  • Timeout (sec.) is the time in seconds after which the VNFM stops attempting to run a script that could not run the first time.
  • Repeat execution indicates whether the script can be re-run:
    • Yes
    • No
  • Stage is the stage of the CPE device operation at which VNFM runs the script.
  • Script is name of the script file or the Ansible playbook file.
  • File is the name of the archive with additional files that the script requires to run.
  • Actions contains the actions that can be performed with the script.

In this section

Adding a script to CPE devices

Manually running a script on CPE devices

Scheduling scripts on CPE devices

Editing a script on CPE devices

Deleting a script on CPE devices

Page top
[Topic 244549]

Adding a script to CPE devices

You can add a script to a CPE template. Scripts added to the CPE template are automatically added to all CPE devices that use this CPE template.

To add a script to CPE devices:

  1. In the menu, go to the SD-WAN → CPE templates section.

    A table of CPE templates is displayed.

  2. Click the CPE template to which you want to add a script.

    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 icon . By default, the Information tab is selected, which displays general information about the CPE template.

  3. Select the Scripts tab.

    This displays the port number that VNFM uses to connect to the CPE device, the user name for running scripts, and the table of script if at least one script has been added.

  4. Click + Script.
  5. This opens a window; in that window, in the Name field, enter the name of the script. Maximum length: 255 characters.
  6. 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. Default value: 360.
  7. In the Executor drop-down list, select one of the following values:
    • Ansible. Default value.
    • Shell
    • Expect
    • Custom to use an interpreter on the CPE device. If you s! this value is selected, enter the path to the interpreter in the Custom executor field.
  8. In the Stage drop-down list, select the stage of CPE device operation at which VNFM runs the script:
    • Registration. Default value.
    • Deletion
    • Manually to run the script only manually.
  9. If you need to run the script again, select the Repeat execution check box. This check box is cleared by default. Consider the following special considerations for re-running a script:
    • If in the Stage drop-down list, you selected Registration, the script is re-run in cases of registration, powering on, and restart of the CPE device.
    • If in the Stage drop-down list, you selected Deletion, the script does not run again.
    • If in the Stage drop-down list, you selected Manually, the script is re-run in cases of powering on and restart of the CPE device.
  10. In the Script field, enter the path to the script file or to the Ansible playbook script file.
  11. If necessary, in the File field, specify the path to the archive with additional files required to run the script. Supported formats of archives with files: TAR.GZ and ZIP.
  12. Click Save.

    The script is created and displayed in the table.

  13. In the upper part of the settings area, click Save to save CPE template settings.
Page top
[Topic 243208]

Manually running a script on CPE devices

You can manually run an individual script or all scripts in a CPE template or on a CPE device. Scripts started in a CPE template are automatically run on all CPE devices that use this CPE template or on CPE devices with specific tags.

Manually running scripts in a CPE template

To manually run scripts in a CPE template:

  1. In the menu, go to the SD-WAN → CPE templates section.

    A table of CPE templates is displayed.

  2. Click the CPE template in which you want to manually run scripts.

    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 icon . By default, the Information tab is selected, which displays general information about the CPE template.

  3. Select the Scripts tab.

    This displays the port number that VNFM uses to connect to the CPE device, the user name for running scripts, and the table of script if at least one script has been added.

  4. To manually run an individual script:
    1. Click Run next to the script that you want to run manually.
    2. This opens a window; in that window, select the CPE devices on which you want to run the script:
      • Run the script <script name> on all related CPEs runs the script on all CPE devices that use the CPE template. Default value.
      • Run <script name> on all related CPEs with specified tags runs the script on CPE devices that use the CPE template and have specific tags assigned. If you select this value, specify the tags in the lower part of the window.
  5. To manually run all scripts:
    1. In the upper part of the settings area, under Actions, click Run scripts.
    2. This opens a window; in that window, select the CPE devices on which you want to run the scripts:
      • Run all scripts on related CPEs to run the scripts on all CPE devices that use the CPE template. Default value.
      • Run all scripts on related CPEs with specified tags to run the scripts on CPE devices that use the CPE template and have specific tags assigned. If you select this value, specify the tags in the lower part of the window.
  6. Click Run.

The scripts are run.

Manually running scripts on a CPE device

To manually run scripts on a CPE device:

  1. In the menu, go to the SD-WAN → CPE section.

    A table of CPE devices is displayed.

  2. Click the CPE device on which you want to manually run scripts.

    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 icon . By default, the Configuration tab is selected, which displays general information about the CPE device. This tab also displays the table of Out-of-band management tasks being performed by the orchestrator.

  3. Select the Scripts tab.

    This displays the port number that VNFM uses to connect to the CPE device, the user name for running scripts, and the table of script if at least one script has been added.

  4. Manually run the scripts in one of the following ways:
    • If you want to manually run an individual script, click Run next to the relevant script.
    • If you want to manually run all scripts, in the upper part of the settings area, under Actions, click Run scripts.
  5. This opens a window; in that window, click Run.

The scripts are run.

Page top
[Topic 256452]

Scheduling scripts on CPE devices

Scheduled tasks for running scripts on CPE devices can be created in the task scheduler. When creating a scheduled task, you must select a CPE template, scripts, and CPE devices on which you want to run the scripts.

You can run scripts on all CPE devices that use a CPE template, or constrain the number of CPE devices by specifying tags or manually selecting CPE devices.

To create a scheduled task to run scripts on CPE devices:

  1. In the menu, go to the Scheduler section.

    The table of scheduled tasks is displayed.

  2. In the upper part of the page, click + Delayed task.
  3. This opens a window; in that window, in the Type drop-down list selectScript execution.
  4. In the Name field, enter the name of the scheduled task.
  5. In the CPEs to run script on drop-down list, select the CPE devices on which you want to run the script:
  6. Under CPE template, select the CPE template that contains the scripts that you want to run.
  7. Under Scripts, select the scripts that you want to run.
  8. In the Completion date and time field, enter the date and time when you want to run the scheduled task. By default, the date and time specified is the date and time when you started creating the scheduled task.
  9. Click Create.

A scheduled task for running the script is created and displayed in the table. The status of the scheduled tasks is displayed in the Status column. If the scheduled task to run a script finishes successfully, its status changes to Done.

Page top
[Topic 247854]

Editing a script on CPE devices

You can edit a script in the CPE template. A script edited in the CPE template is automatically modified on all CPE devices that use this CPE template.

To edit a script on CPE devices:

  1. In the menu, go to the SD-WAN → CPE templates section.

    A table of CPE templates is displayed.

  2. Click the CPE template in which you want to edit a script.

    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 icon . By default, the Information tab is selected, which displays general information about the CPE template.

  3. Select the Scripts tab.

    This displays the port number that VNFM uses to connect to the CPE device, the user name for running scripts, and the table of script if at least one script has been added.

  4. Click Edit next to the script that you want to edit.
  5. This opens a window; in that window, if necessary, edit the script settings. For a description of the settings, see the instructions for adding a script on CPE devices.
  6. Click Save.

    The script is modified and updated in the table.

  7. In the upper part of the settings area, click Save to save CPE template settings.
Page top
[Topic 256356]

Deleting a script on CPE devices

You can delete a script in the CPE template. A script deleted in the CPE template is automatically deleted on all CPE devices that use this CPE template.

Deleted scripts cannot be restored.

To delete a script on CPE devices:

  1. In the menu, go to the SD-WAN → CPE templates subsection.

    A table of CPE templates is displayed.

  2. 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 icon . By default, the Information tab is selected, which displays general information about the CPE template.

  3. Select the Scripts tab.

    This displays the port number that VNFM uses to connect to the CPE device, the user name for running scripts, and the table of script if at least one script has been added.

  4. Click Delete next to the script that you want to delete.

    The script is deleted and is no longer displayed in the table.

  5. In the upper part of the settings area, click Save to save CPE template settings.
Page top
[Topic 256358]