Fortinet black logo
24.2.0

CLI scripts

CLI scripts

You can configure and schedule scripts of CLI commands to run on your FortiGates. For FortiOS CLI command information, see the FortiOS CLI Reference.

To create a script:
  1. Go to CLI scripts > Script list.
  2. Click Create new.
  3. In the CLI script field, enter the desired FortiOS CLI commands to run on the FortiGates.
  4. Configure other fields as desired, then click OK.
To run a script:
  1. Go to CLI scripts > Script list. Select the desired script, then click Run.
  2. In FortiGates, select the desired FortiGates.
  3. In the Execution schedule toggle, select one of the following:
    • To run the script immediately, click Immediate.
    • To schedule the script to run at a desired time, select Scheduled. Configure the desired time to run the script. Click OK.

You can view and edit scheduled script runs in CLI Scripts > Script tasks > Scheduled scripts. You can view the script run results in CLI scripts > Script tasks > Run results.

CLI scripts

You can configure and schedule scripts of CLI commands to run on your FortiGates. For FortiOS CLI command information, see the FortiOS CLI Reference.

To create a script:
  1. Go to CLI scripts > Script list.
  2. Click Create new.
  3. In the CLI script field, enter the desired FortiOS CLI commands to run on the FortiGates.
  4. Configure other fields as desired, then click OK.
To run a script:
  1. Go to CLI scripts > Script list. Select the desired script, then click Run.
  2. In FortiGates, select the desired FortiGates.
  3. In the Execution schedule toggle, select one of the following:
    • To run the script immediately, click Immediate.
    • To schedule the script to run at a desired time, select Scheduled. Configure the desired time to run the script. Click OK.

You can view and edit scheduled script runs in CLI Scripts > Script tasks > Scheduled scripts. You can view the script run results in CLI scripts > Script tasks > Run results.