FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
gmanea
Staff
Staff
Article Id 191859

Description

 

This article describes how to set up FortiGate to reboot daily, at a pre-defined time.

 

Scope

 

FortiGate.

 

Solution

 

FortiOS firmware allows the user to program a daily restart (reboot) of the FortiGate, at a pre-defined hour.  This is a repeated reboot and it can be used for a one-time reboot at a predefined hour (with the mention that it needs to be removed afterward). An alternate option is available in the form of an auto-script that can further fine-tune the reboot, cycle, or add additional commands (from v5.6). 

 

From v6.2, a more advanced way can be used - Automation Stitch (FortiOS 6.0 has Automation Stitch, but can only be triggered by an event, and not Scheduled).
Daily restart.
This option is configurable from the CLI as shown in the example below:

 
config system global
    set daily-restart enable
    set restart-time 05:06
end
 
Once the restart time is reached, the following message is displayed on the CLI console:
 
The system will reboot due to scheduled daily restart. Current time is 05:06
 
Syslog message relating to this event:
 
2024-30-05 05:06:51 log_id=0104041990 type=event subtype=admin pri=information fwver=040000 vd=root msg="Fortigate started"
 
The following entry will be logged under the GUI event logs:
 
2021-10-21    05:06:51    information    admin    41990    Fortigate started
 
Automation stitch reboot.
This option presents another level of 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.
 
Note:
Use short, simple names, and no spaces in the name field.
 
Stephen_G_0-1717078630851.png
 
The CLI commands created by this action:
 
config system automation-action
    edit "rebooot"
        set action-type cli-script
        set required enable
        set script "exec reboot"
        set accprofile "super_admin"
end
config system automation-trigger
    edit "autoreboot"
        set trigger-type scheduled
        set trigger-frequency weekly
        set trigger-weekday monday
        set trigger-hour 20
        set trigger-minute 10
    next
end
config system automation-stitch
    edit "auto reboot"
        set trigger "autoreboot"
            config actions
                edit 1
                    set action "rebooot"
                    set required enable
                next
            end
end
 
image - 2024-11-16T164229.083.png

Note:
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 send automated backups of the configuration from a FortiGate with an automatio...