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.
kyozloveyou_FTNT
Article Id 348016
Description This article describes the uses of FotiAnalyzer to help trigger failover when high CPU usage occurs. As known at this moment, there is no mechanism to trigger HA failover when during high CPU usage.
Scope FortiGate and FortiAnalyzer with IOC license.
Solution

On FortiGate site:

 

Step 1: Create trigger.

 

KB-cpu1.png

 

Choose webhook and provide a name:

 

KB-cpu2.png

 

KB-cpu3.png

 

URL for webhook is created and select 'OK':


KB-cpu4.png

 

Step 2: Create Action:

 

KB-cpu6.png

 

KB-cpu7.png

 

Step 3: create a stitch.

 

KB-cpu8.png

 

KB-cpu9.png

 

On the FortiAnalyzer site:

 

Step 1: Create an event handler for CPU usage under FortiSoC -> Event Handler and search for CPU:

 

KB-cpu10.png

 

'Right-click' 'Default-NOC-System-Events' and clone. Edit the cloned Event handler by enabling status, change meaningful name and remove all the rules except CPU:

 

KB-cpu11.png

 

Edit the CPU consumption detection, set the duration of the handler and change the CPU threshold:

 

KB-cpu12.png

 

KB-cpu13.png

 

Step 2: create Playbook. Before creating a playbook, make sure the connector is updated with the webhook created on the FortiGate:

 

KB-cpu14.png

 

Once the automation rule is there in Connector, go to playbook and create new playbook:

 

KB-cpu15.png

 

KB-cpu16.png

 

Select 'EVENT_TRIGGER':

 

KB-cpu17.png

 

Select '+' and set the basic event handler and choose the CPU usage handler created in step 1.

 

KB-cpu18.png

 

Select and drag the blue half circle for next action and choose FortiOS:

 

KB-cpu19.png

 

KB-cpu20.png

 

Give the Task name and set the playbook information and save the playbook:

 

KB-cpu21.png

 

KB-cpu22.png

 

Failover test.

Step 1: Simulate the CPU to reach the threshold:

 

KB-test1.png

 

Step 2: Check the event handler trigger. After 5 minutes, the Event handler will triggered as FortiGate will generate performance statistics logs every 5minutes:

 

KB-test2.png

 

Step 3: make sure the playbook is run:

 

KB-test3.png

 

Step 4: Check the FortiGate failover. Now the 'FG2' is the master.

 

KB-test4.png