Fortinet black logo

Script

23.4.0
Copy Link
Copy Doc ID ce71c0e4-7759-11ee-a142-fa163e15d75b:202105
Download PDF

Script

In Script, you can create and run script files on connected remote devices to check device status or get bulk configuration information quickly.

To execute a script on a remote device:
  1. Go to Management > Script.
  2. (Optional) To create a new script, do the following:
    1. Select Add.
    2. Enter a name and a description, and the CLI script content that you want to run. Each script is a series of CLI commands, one command per line. Click OK.

  3. Go to Assets.
  4. Right-click the desired device, then select Group Management > Run Script.
  5. From the Script Name dropdown list, select the desired script.
  6. In the Schedule field, configure the time to run the script. You can also select Run Now to run the script immediately.
  7. FortiGate Cloud automatically displays the Task Status page. To cancel the scheduled run, select the desired task, then click Cancel. FortiGate Cloud records the script output. You can read it by clicking View Result.
To download a deployment log:
  1. Go to Management > Script.
  2. Do one of the following:
    1. To download the log for a script's last successful deployment, click View Result for the desired script.
    2. To download the log for another deployment, click History. Beside the desired deployment instance, click Log.
  3. Click Download.
To use scripts to manage configuration settings on multiple FortiGates:
  1. Copy the desired CLI commands from FortiOS:
    1. In FortiOS, go to System > Settings.
    2. Under Workflow Management, set Configuration save mode to Manual.
    3. Make configuration changes in FortiOS as desired.
    4. The top banner displays a There are unsaved changes notification. Click the notification and select View unsaved changes.
    5. Copy the CLI commands in the View Unsaved Changes panel.
  2. Configure a script in FortiGate Cloud:
    1. In FortiGate Cloud, go to Management > Script.
    2. Select Add.
    3. Enter a name and a description, and paste the CLI script content that you copied from FortiOS. Click OK.
  3. Go to Assets.
  4. Select the desired FortiGates.
  5. From the Group Management dropdown list, select Run Script.
  6. From the Script Name dropdown list, select the created script.
  7. In the Schedule field, configure the desired time to run the script, or click Run Now to run the script immediately.
  8. Click Submit.

Script

In Script, you can create and run script files on connected remote devices to check device status or get bulk configuration information quickly.

To execute a script on a remote device:
  1. Go to Management > Script.
  2. (Optional) To create a new script, do the following:
    1. Select Add.
    2. Enter a name and a description, and the CLI script content that you want to run. Each script is a series of CLI commands, one command per line. Click OK.

  3. Go to Assets.
  4. Right-click the desired device, then select Group Management > Run Script.
  5. From the Script Name dropdown list, select the desired script.
  6. In the Schedule field, configure the time to run the script. You can also select Run Now to run the script immediately.
  7. FortiGate Cloud automatically displays the Task Status page. To cancel the scheduled run, select the desired task, then click Cancel. FortiGate Cloud records the script output. You can read it by clicking View Result.
To download a deployment log:
  1. Go to Management > Script.
  2. Do one of the following:
    1. To download the log for a script's last successful deployment, click View Result for the desired script.
    2. To download the log for another deployment, click History. Beside the desired deployment instance, click Log.
  3. Click Download.
To use scripts to manage configuration settings on multiple FortiGates:
  1. Copy the desired CLI commands from FortiOS:
    1. In FortiOS, go to System > Settings.
    2. Under Workflow Management, set Configuration save mode to Manual.
    3. Make configuration changes in FortiOS as desired.
    4. The top banner displays a There are unsaved changes notification. Click the notification and select View unsaved changes.
    5. Copy the CLI commands in the View Unsaved Changes panel.
  2. Configure a script in FortiGate Cloud:
    1. In FortiGate Cloud, go to Management > Script.
    2. Select Add.
    3. Enter a name and a description, and paste the CLI script content that you copied from FortiOS. Click OK.
  3. Go to Assets.
  4. Select the desired FortiGates.
  5. From the Group Management dropdown list, select Run Script.
  6. From the Script Name dropdown list, select the created script.
  7. In the Schedule field, configure the desired time to run the script, or click Run Now to run the script immediately.
  8. Click Submit.