Working with Scripts : Script samples : CLI scripts : Troubleshooting Tips
 
Troubleshooting Tips
Here are some troubleshooting tips to help locate and fix problems you may experience with your scripts.
Check the script output. Generally the error messages displayed here will help you locate and fix the problem.
See the FortiGate CLI Reference for more information on all CLI commands.
There is a limit to the number of scripts allowed on the FortiManager unit. Try removing an old script before trying to save your current one.
As mentioned at the start of this chapter, ensure the console more command is disabled on the FortiGate devices where scripts execute. Otherwise a condition may occur where both the FortiGate device and the FortiManager system are waiting for each other to respond until they timeout.
There should be no punctuation at the start or end of the lines.
Only whitespace is allowed on the same line as the command. This is useful in lining up end and next commands for quick and easy debugging of the script.
Keep your scripts short. They are easier to troubleshoot and it gives you more flexibility. You can easily execute a number of scripts after each other.
Use full command names. For example instead of “set host test” use “set hostname test”. This is required for any scripts that are to be run on the global database.
Use the number sign (#) to comment out a line you suspect contains an error.