Technical Tip: Using Automation Stitch to schedule restart (reboot) FortiGate
Description
This article describes how to set up FortiGate to reboot at a pre-defined time.
Scope
FortiGate.
Solution
Automation stitch reboot.
The option presents integration with the operational level of the network.
An action can be triggered based on specific predefined triggers.
In this example, a periodic reboot not triggered by a specific event has been used. Instead, here a scheduled reboot is being configured.
Note:
Use short, simple names, and preferably no spaces (if used, use colon in the CLI) in the name field.
Security Fabric>Automation>Create New
Select Schedule
Frequency can be according to the requirement
Action will be CLI Script
select super_admin
Can be tested via Test Automation StichThe CLI commands created by this action:
config system automation-trigger
edit "Weekly Reboot"
set trigger-type scheduled
set trigger-frequency weekly
set trigger-weekday sunday
set trigger-hour 23
set trigger-minute 1
next
end
edit "Weekly Reboot"
set trigger-type scheduled
set trigger-frequency weekly
set trigger-weekday sunday
set trigger-hour 23
set trigger-minute 1
next
end
config system automation-action
edit "Weekly Reboot"
set trigger "Weekly Reboot"
config actions
edit 1
set action "Reboot"
set required enable
next
end
next
end
edit "Reboot"
set action-type cli-script
set script "execute reboot"
set accprofile "super_admin"
next
set action-type cli-script
set script "execute reboot"
set accprofile "super_admin"
next
end
config system automation-stitchedit "Weekly Reboot"
set trigger "Weekly Reboot"
config actions
edit 1
set action "Reboot"
set required enable
next
end
next
end
Note:
FortiGate's built-in automation scheduler allows for specifying a day of the month (e.g., the 3rd), but not the day of the week (e.g., every second Tuesday)
If the FortiGate is set up in HA, additional configuration is required to reboot the cluster: Technical Tip: Automate the scheduling of reboots for the HA cluster using an automation stitch
From v7.2 onward, there is a new action type 'system action' which can be used to reboot, shut down, or back up the config of the FortiGate. Refer to this document for more details: System automation actions to back up, reboot, or shut down the FortiGate

Related articles:
Technical Tip: Automated script execution
Technical Tip: Use FortiGate automation stitches for alert emails
Technical Tip: How to properly shut down or reboot a FortiGate
