Fortinet white logo
Fortinet white logo

Administration Guide

Import a script

Import a script

CLI and Jinja scripts can be imported as text files from your local computer using the FortiManager GUI. See Importing CLI and Jinja scripts

Tcl scripts can be imported using the FortiManager CLI using FTP or SCP. See Importing Tcl scripts

Importing CLI and Jinja scripts
To import a script:
  1. Go to Device Manager > Scripts.

  2. Select More > Import from the toolbar. The Import CLI Script window opens.

  3. Drag-and-drop the script file onto the dialog box, or click Add Files and locate the file to be imported on your local computer.

  4. Click Import to import the script.

  5. Enter a Script Name, choose the Script Type (CLI or Jinja), and if applicable you can select where to Run Script On (Device Database, Remote FortiGate Directly, or Policy Package or ADOM Database.

  6. Click OK.

To import a script in the Global Database ADOM:
  1. Go to Policy & Objects > Object Configuration > Advanced > Scripts.

  2. Select Import from the toolbar. The Import Script dialog box opens.

  3. Enter a name for the script and, optionally, comments, in the requisite fields.

  4. Click Browse... and locate the file to be imported on your local computer.

  5. Click Import to import the script.

You can also import scripts using the FortiManager CLI. For more information, see the FortiManager CLI Reference.

If the script cannot be read due to an incorrect file type or other issue, an error message will be displayed and the import process will be canceled.

Importing Tcl scripts

Tcl scripts can only be imported using the FortiManager CLI.

Importing a Tcl script as a text file using the Import CLI Script function in the FortiManager GUI will import the script as CLI and it will not function correctly.

To import a Tcl script using the FortiManager CLI, enter the following command to import the script by FTP/SCP:

execute fmscript import {scp | ftp} <server> <finename> <username> <password> <scriptname> <TCL> <target> <comment> <adom_name> <os_type> <os_version> <platform> <devicename> <buildno> <hostname> <serial number>

Import a script

Import a script

CLI and Jinja scripts can be imported as text files from your local computer using the FortiManager GUI. See Importing CLI and Jinja scripts

Tcl scripts can be imported using the FortiManager CLI using FTP or SCP. See Importing Tcl scripts

Importing CLI and Jinja scripts
To import a script:
  1. Go to Device Manager > Scripts.

  2. Select More > Import from the toolbar. The Import CLI Script window opens.

  3. Drag-and-drop the script file onto the dialog box, or click Add Files and locate the file to be imported on your local computer.

  4. Click Import to import the script.

  5. Enter a Script Name, choose the Script Type (CLI or Jinja), and if applicable you can select where to Run Script On (Device Database, Remote FortiGate Directly, or Policy Package or ADOM Database.

  6. Click OK.

To import a script in the Global Database ADOM:
  1. Go to Policy & Objects > Object Configuration > Advanced > Scripts.

  2. Select Import from the toolbar. The Import Script dialog box opens.

  3. Enter a name for the script and, optionally, comments, in the requisite fields.

  4. Click Browse... and locate the file to be imported on your local computer.

  5. Click Import to import the script.

You can also import scripts using the FortiManager CLI. For more information, see the FortiManager CLI Reference.

If the script cannot be read due to an incorrect file type or other issue, an error message will be displayed and the import process will be canceled.

Importing Tcl scripts

Tcl scripts can only be imported using the FortiManager CLI.

Importing a Tcl script as a text file using the Import CLI Script function in the FortiManager GUI will import the script as CLI and it will not function correctly.

To import a Tcl script using the FortiManager CLI, enter the following command to import the script by FTP/SCP:

execute fmscript import {scp | ftp} <server> <finename> <username> <password> <scriptname> <TCL> <target> <comment> <adom_name> <os_type> <os_version> <platform> <devicename> <buildno> <hostname> <serial number>