CLI scripts
|
|
When you run a function in FortiGate Cloud that applies to FortiGates, such as running a script, FortiGate Cloud may not pass the actual username of the user who performed the action to FortiOS: When remotely accessing a FortiGate from FortiGate Cloud, one of the following occurs:
For other management features that a user can perform from FortiGate Cloud, such as running a script, FortiGate Cloud passes the username of the FortiGate Cloud user who performed the action as FortiGateCloud to FortiOS. Therefore, when viewing logs on the affected FortiGate, you may see 4aa567e55bc8@fortigatecloud.com or FortiGateCloud as a username. For managed security service provider customers, this provides enhanced security by preventing subusers from seeing the primary account email address in the FortiGate logs. |
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:
- Go to CLI scripts > Script list.
- Click Create new.
- In the CLI script field, enter the desired FortiOS CLI commands to run on the FortiGates.
- Configure other fields as desired, then click OK.
To run a script:
- Go to CLI scripts > Script list. Select the desired script, then click Run.
- In FortiGates, select the desired FortiGates.
- 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.