Technical Tip: How to get a periodically email alert for the CPU and MEMORY usages
Description
This article describes how to get an email alert at a particular time interval with respect to Memory and CPU usage levels.
Scope
FortiGate.
Solution
Go to the Security Fabric -> Automation, select 'Create New' and add a name (Ex: Monitor_CPU_Memory).

After that, select the 'Add Trigger' option and select 'Create'.
From the open tab, select 'FortiOS Event Log' under Miscellaneous:

Add a name (for example, 'CPU_Mem_Usages') under the event field, select 'System performance statistics', and select 'OK':

After, select the trigger and select 'Apply'.
Thereafter, select 'add action' and 'create' an email notification:

Then add a name (for example, 'Email_Notification') and, in the email section, add the email (for example, abc@gmail.com).
After, edit the subject (%%log.logdesc%%) and body (%%log%%) as per requirement and select 'OK'.
On the minimum interval filed, it is possible to set how frequent to get an alert.

Finally, select the default email and select 'Apply'.
The example logs will look like the following.
date=2022-04-29 time=09:08:45 devid="FGVM02TM20000569" devname="nitrogen-kvm60" eventtime=1651216124813424037 tz="+0200" logid="0100040704" type="event" subtype="system" level="notice" vd="root" logdesc="System performance statistics" action="perf-stats" cpu=0 mem=55 totalsession=39 disk=1 bandwidth="5/115" setuprate=1 disklograte=0 fazlograte=0 freediskstorage=15190 sysuptime=87022 waninfo="N/A" msg="Performance statistics: average CPU: 0, memory: 55, concurrent sessions: 39, setup-rate: 1"
It is also possible to monitor conserve mode events or High CPU events via Automation Stitch:
- Conserve mode: Technical Tip: Automation stitch for conserve mode
- High CPU: Technical Tip: Execute a CLI script based on high CPU