Skip to main content
msanjaypadma
Staff
Staff
October 29, 2024

Technical Tip: Email alert for single CPU core spike

  • October 29, 2024
  • 0 replies
  • 973 views
Description

 

This article describes generating email alerts for a single CPU core spike.

 

Scope

 

FortiGate.

 

Solution

 

Refer below steps to configure the automation stitch for generating mail alerts for a single CPU core spike.

 

  1. Navigate Security Fabric and select Automation.
     
    Capture11.PNG

 

  1. Select Create New to create a new automation stitch.

    capture12.PNG

     

     

  2. Configure the Name and enable the status.

     

  3. Select Add Trigger to configure the trigger condition and then select Create New and then FortiOS Event Logs.

     

    Capture13.PNG

     

  4. Configure the Name, select FortiOS Event ID: 40707, and select OK.
                                                                            

    capture14.png                                                         

     

  5. Once Automation Trigger is configured, apply the object to Trigger.

  6. Select Add Action and New or select an existing email notification action.

  7. After selecting New, select the Email option from the notification. 

  8. Configure the fields Name, From, To, and select OK.
                                                            

    Capture16.PNG

  9. Select OK.

                                                         

capture17.PNG

 

Make sure the below command is enabled to log the event. Any single CPU core usage above the CPU usage threshold will report an event log.

 

config system global
    set log-single-cpu-high enable
end

 

To make sure that the email daemon is working as expected, a test log email alert can be generated using the command: diagnose log alertmail test.

 

Debugging commands to verify and troubleshoot the email alert.

 

diagnose debug console timestamp e

diagnose debug app alertmail -1

diagnose debug en

 

The example alertmail debug output below can be used as a reference when the Automation Stitch for High CPU is triggered.

 

acvaldez_0-1771215203565.png

 

# 2026-02-13 08:45:21 Arrived msg(type 10, 1758 bytes):acvaldez@manila.ph;

stitchadmin@fortinet.com

Admin login successful

<!DOCTYPE html>

<html lang="en">

    <head>

        <meta charset="UTF-8">

        <meta http-equiv="X-UA-Compatible" content="IE=8; IE=EDGE">

        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">

        <style>

            body {

                height: 100%;

                font-family: Roboto, Helvetica, Arial, sans-serif;

                margin: 0;

                display: flex;

                align-items: center;

                justify-content: center;

            }

            .message-container{

                margin: 0 auto;

                max-width: 580px;

            }

            .email-body {

                line-height: 1.5em;

            }

        </style>

    </head>

    <body>

        <div class="message-container">

            <img src="https://filestore.fortinet.com/fortiguard/logo_v3_fguard_app.png" alt="Fortinet Logo"/>

            <h1>Security Fabric Automation</h1>

            <h3>FGVM01TM21001378: LOGIN ATTEMPT</h3>

            <div class="email-body">

                date=2026-02-13 time=08:45:21 devid="FGVM01TM21001378" devname="Ertiga-kvm06" eventtime=1770943520888105719 tz="+0800" logid="0100032001" type="event" subtype="system" level="information" vd="root" logdesc="Admin login successful" sn="1770943520" user="admin" ui="jsconsole" method="jsconsole" srcip=10.250.0.40 dstip=10.47.19.63 action="login" status="success" reason="none" profile="super_admin" msg="Administrator admin logged in successfully from jsconsole"

            </div>

        </div>

    </body>

</html>

2026-02-13 08:45:21 mail_info:

        from:mail.manila.ph     user:stitchadmin@fortinet.com

2026-02-13 08:45:21 mail_info:

        reverse path:stitchadmin@fortinet.com

        user name:stitchadmin

2026-02-13 08:45:21 to[0]:acvaldez@manila.ph

2026-02-13 08:45:21 <==_init_mail_info

2026-02-13 08:45:21 create session

2026-02-13 08:45:21 ==> send mail

2026-02-13 08:45:21 connecting to 10.47.20.197 port 25

2026-02-13 08:45:21 send mail 0x55f2986c8a50 session 0x55f2986c85c0

2026-02-13 08:45:21 session: 0x55f2986c85c0, rsp_state: greeting, code: 220

2026-02-13 08:45:21 session: 0x55f2986c85c0, rsp_state: ehlo, code: 250

2026-02-13 08:45:21 session: 0x55f2986c85c0, rsp_state: mail, code: 250

2026-02-13 08:45:21 session: 0x55f2986c85c0, rsp_state: rcpt, code: 250

2026-02-13 08:45:21 session: 0x55f2986c85c0, rsp_state: data, code: 354

2026-02-13 08:45:21 === send: <!DOCTYPE html>

<html lang="en">

    <head>

        <meta charset="UTF-8">

        <meta http-equiv="X-UA-Compatible" content="IE=8; IE=EDGE">

        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">

        <style>

            body {

                height: 100%;

                font-family: Roboto, Helvetica, Arial, sans-serif;

                margin: 0;

                display: flex;

                align-items: center;

                justify-content: center;

            }

            .message-container{

                margin: 0 auto;

                max-width: 580px;

            }

            .email-body {

                line-height: 1.5em;

            }

        </style>

    </head>

    <body>

        <div class="message-container">

            <img src="https://filestore.fortinet.com/fortiguard/logo_v3_fguard_app.png" alt="Fortinet Logo"/>

            <h1>Security Fabric Automation</h1>

            <h3>FGVM01TM21001378: LOGIN ATTEMPT</h3>

            <div class="email-body">

                date=2026-02-13 time=08:45:21 devid="FGVM01TM21001378" devname="Ertiga-kvm06" eventtime=1770943520888105719 tz="+0800" logid="0100032001" type="event" subtype="system" level="information" vd="root" logdesc="Admin login successful" sn="1770943520" user="admin" ui="jsconsole" method="jsconsole" srcip=10.250.0.40 dstip=10.47.19.63 action="login" status="success" reason="none" profile="super_admin" msg="Administrator admin logged in successfully from jsconsole"

            </div>

        </div>

    </body>

</html>

 

 

2026-02-13 08:45:21 session: 0x55f2986c85c0, rsp_state: data2, code: 250

2026-02-13 08:45:21 session: 0x55f2986c85c0, rsp_state: quit, code: 221

2026-02-13 08:45:21 session finined

2026-02-13 08:45:21 _session_on_destroy

2026-02-13 08:45:21 <== send mail success, m = 0x55f2986c8a50 s = 0x55f2986c85c0 

 

The following is an example email notification that will be sent once the CPU Automation Stitch is triggered.

 

acvaldez_1-1771215203601.png

 

Related article:

Technical Tip: How to configure alert email settings