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.
tpatel
Staff
Staff
Article Id 407802
Description This article describes how to configure the automation stitch to reboot the managed FortiSwitch daily at a desired time.
Scope FortiGate.
Solution

Here are the CLI script to configure this automation stitch for 1:00am specific time and date:

Step 1 (Automation Action):

config system automation-action

    edit "Restart_FortiSwitch_action"

        set action-type cli-script

        set script "execute switch-controller switch-action restart swtp all"

        set accprofile "super_admin"

    next

end

 
auto_action.png

 



Step 2 (Automation Trigger):

 

config system automation-trigger

    edit "restart_FortiSwitch_trigger"

         set trigger-type scheduled
         set trigger-frequency once
         set trigger-datetime 2025-08-26 01:00:00 <----- Scheduled for 1:00 am, this can be changed as desired.

    next

end

 

auto_trigger.png

 

Step 3 (Automation Stitch):

config system automation-stitch

    edit "Restart_FortiSwitch_stitch"

       set trigger "restart_FortiSwitch_trigger"

           config actions

              edit 1

                  set action "Restart_FortiSwitch_action"

                  set required enable

              next

           end

    next

end

 

auto_stitch.png

 

Note:

  • To reboot a specific FortiSwitch by name , replace the script with 'execute switch-controller switch-action restart swtp switch-id <switch1>'.
  • To restart multiple FortiSwitches (and not all), the command is 'execute switch-controller switch-action restart swtp switch-group <switch-group ID>'. 

Related document:
Execute switch-controller