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.
alif
Staff
Staff
Article Id 262336

 

Description This article discusses the generation of automatic scripts whenever an automation stitch is triggered.
Scope FortiGate.
Solution

Let's consider that there is an automation stitch configured on the FortiGate to track high CPU Utilization:

 

config system automation-action
    edit "CPU Stats"
        set action-type cli-script
        set minimum-interval 60
        set script "get system performance status
            get system performance top"
                set accprofile "super_admin"
            next
        end

 

config system automation-stitch
    edit "High CPU Usage Alert"
    set trigger "High CPU Usage Alert"
        config actions
            edit 1
                set action "CPU Stats"
                set required enable
            next
        end
    next
end

 

config system automation-trigger
        edit "High CPU Usage Alert"
            set trigger-type scheduled
            set trigger-hour 7
            set trigger-minute 30
        next
    end

 

The auto-script is empty at this moment:

 

FGT # show system auto-script
config system auto-script
end

 

Whenever the automation stitch is triggered, the automation script (show system auto-script) gets automatically generated. 

 

 As the triggered time is defined as 7:30, an automatic script got generated:

 

FGT # 2023-06-29 07:30:05 0: config system auto-script
2023-06-29 07:30:05 0: edit "autod.0"
2023-06-29 07:30:05 0: set script "get system performance status
2023-06-29 07:30:05 0: get system performance top"
2023-06-29 07:30:05 0: end

  

FGT # show system auto-script
    config system auto-script
        edit "autod.0"
            set script "get system performance status
            get system performance top"
        next
    end 

 

Related articles:

Technical Tip: Automated script execution

Technical Tip: Use FortiGate automation stitches for alert emails