Advanced Features : Scripting
 
Scripting
FortiManager scripts enable you to create, execute, and view the results of scripts executed on FortiGate devices, policy packages, the ADOM database, the global policy package, or the DB. Scripts can also be filtered based on different device information, such as OS type and platform.
At least one FortiGate device must be configured on the FortiManager system for you to be able to use scripts.
 
Any scripts that are run on the global database must use complete commands. For example, if the full command is config system global, do not use conf sys glob.
Scripts can be written in one of two formats:
A sequence of FortiGate CLI commands, as you would type them at the command line. A comment line starts with the number sign (#). A comment line will not be executed.
Tcl scripting commands to provide more functionality to your scripts including global variables and decision structures.
When writing your scripts, it is generally easier to write them in a context-sensitive editor, and then cut and paste them into the script editor on your FortiManager system. This can help avoid syntax errors and can reduce the amount of troubleshooting required for your scripts.
For information about scripting commands, see FortiGate CLI reference.
 
Before using scripts, ensure the console more function has been disabled in the FortiGate CLI. Otherwise, scripts and other output longer than a screen in length will not execute or display correctly.