This article describes how to create an automation stitch on FortiGate to automatically send an email when a certain port comes up or down.
It is possible to differentiate between the serial number of a FortiSwitch, so the stitch can be triggered when a specific port from a specific FortiSwitch flapped. This is especially useful for some users who want to actively monitor their network.
FortiSwitch, FortiGate.
Every event logs from System events have a specific Log ID. In this case, the log ID for 32695 corresponds to an event on the switch-controller and corresponds to a port change.
config system automation-action
edit "email-interface-change"
set action-type email
set email-to "your@email.com"
set email-subject "Change interface status notification email"
next
end
Make sure to change the email-to field for the actual email of the receiver.
config system automation-trigger
edit "test_interface_down"
set event-type event-log
set logid 32695 <----- Notice the logid 32695.
config fields
edit 1
set name "msg"
set value "primary switch port port1 has gone down" <----- Notice the exact message value. Change the port number as needed.
next
edit 2
set name "sn"
set value "S124FPTFXXXXXXXX" <----- Notice the Serial number of the device to monitor.
next
end
next
end
config system automation-stitch
edit "Test-interface-down"
set trigger "test_interface_down" <----- Notice the name of the trigger configured in step 4.
config actions
edit 1
set action "email-interface-change" <----- Notice the name of the action configured in step 3.
set required enable
next
end
next
end
The configurations can also be done through GUI. Make sure to configure the following in this order:
Result:
If everything is correctly configured, an email from DoNotReply@notification.fortinet.net should be received. This email can be also modified.
For further details, check the automation stitch documentation: Automation stitches
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2024 Fortinet, Inc. All Rights Reserved.