Technical Tip: Email alert when WAN interface went down
| Description | This article describes how to configure an automation stitch to trigger an email alert when a link-monitor goes down. |
| Scope | FortiGate v6.4.x, v7.0.x, v7.2.x., v7.4.x, FortiProxy. |
| Solution | This article gives steps for interfaces that are not SD-WAN member. If the interface is an SD-WAN member, see
Components:
CLI configuration:
config system link-monitor edit "LM_wan1" set srcintf "wan1" set server "8.8.8.8" "4.2.2.2" set gateway-ip 198.51.100.1 set update-static-route {enable | disable} next end
Important: If the alert email would be sent over the primary WAN interface, consider how the firewall will route the traffic for the alert email when the Link Monitor fails. To force the FortiGate to use a different interface for sending the email, 'set update-static-route enable' should be set in Link Monitor configuration to disable the primary WAN route when the link monitor fails, or the email server should be configured 'set interface-specify-method specify' to always send email using the backup interface.
config system email-server set interface-select-method specify set interface "wan2" end
Link Monitor Down:
config system automation-trigger edit "LM2-down_trigger" set event-type event-log set logid 22932 config fields edit 1 set name "name" set value "LM_wan1" <--- name of link monitor. next edit 2 set name "msg" set value "Link Monitor changed state from alive to dead, protocol: ping." next end next end
config system automation-action edit "LM2-down_email" set action-type email next end
config system automation-stitch edit "LM2-down_stitch" set trigger "LM2-down_trigger" config actions edit 1 set action "LM2-down_email" set required enable next end next end
If a protocol other than 'ping' is configured on the Link Monitor, replace 'protocol: ping' in the 'msg' filter with the configured probe protocol, for example:
date=2026-03-12 time=22:27:10 eventtime=1773379630148724640 tz="-0700" logid="0100022932" type="event" subtype="system" level="warning" vd="root" logdesc="Link monitor status warning" name="LM_wan1" interface="wan1" probeproto="http" msg="Link Monitor changed state from alive to dead, protocol: http."
Link monitor up: Similar configuration to 'Link Monitor Down' above, but with a different automation trigger. Note the different event ID, 22922, rather than 22932.
config system automation-trigger edit "LM2-up_trigger" set event-type event-log set logid 22922 config fields edit 1 set name "name" set value "LM_wan1" <--- name of link monitor. next edit 2 set name "msg" set value "Link Monitor changed state from dead to alive, protocol: ping." next end next end
Note: See Email alerts for email server configuration steps.
GUI configuration: Navigate to Security Fabric -> Automation -> Action and select 'Create New'.
Select 'Email':
Enter the Email address where to receive an email alert:
Select Trigger and select 'Create New':
Name the trigger and add the Link monitor status under the event:
Link monitor changed to down: Select 'Link monitor status warning' for event ID.
In the Field filter(s), enter the link monitor's name for 'name', and 'Link Monitor changed state from alive to dead, protocol: ping.' for 'msg'.
Note these values are case-sensitive, and the full field value must be used, including the trailing stop. For example, entering 'Link Monitor changed state from alive to dead' for the msg filter will not work, since it does not include ', protocol: ping.'.
Link monitor changed to up: Select 'Link monitor status' for event ID.
In Field filter(s), enter the link monitor's name for 'name', and 'Link Monitor changed state from dead to alive, protocol: ping.' for 'msg'.
Select Stitch and then select 'Create new'.
Add the trigger that was created in the above steps.
Add the action (Email), which was created in the above steps.
The configuration is now complete:
Note: 'Test Automation Stitch' is greyed out for stitches triggered by an event log. Refer to this article: Technical Tip: 'Test Automation Stitch' button is greyed out when trying to test a newly created automation stitch.
When the link-monitor status changes from alive to dead, an event ID 22932 is generated by the system, which will trigger an email configured in the automation action.
Link Monitor: LM_wan1, Status: dead, Server num(1), cfg_version=0 HA state: local(dead), shared(dead)
Notes:
To filter events based on log parameters, follow the steps in this article:
Related documents: |










