fortios_alertemail_setting – Configure alert email settings in Fortinet’s FortiOS and FortiGate

New in version 2.9.

Synopsis

  • This module is able to configure a FortiGate or FortiOS (FOS) device by allowing the user to set and modify alertemail feature and setting category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v6.0.5

Requirements

The below requirements are needed on the host that executes this module.

  • fortiosapi>=0.9.8

Parameters

Parameter Choices/Defaults Comments
alertemail_setting
dictionary
Configure alert email settings.
admin_login_logs
string
    Choices:
  • enable
  • disable
Enable/disable administrator login/logout logs in alert email.
alert_interval
integer
Alert alert interval in minutes.
amc_interface_bypass_mode
string
    Choices:
  • enable
  • disable
Enable/disable Fortinet Advanced Mezzanine Card (AMC) interface bypass mode logs in alert email.
antivirus_logs
string
    Choices:
  • enable
  • disable
Enable/disable antivirus logs in alert email.
configuration_changes_logs
string
    Choices:
  • enable
  • disable
Enable/disable configuration change logs in alert email.
critical_interval
integer
Critical alert interval in minutes.
debug_interval
integer
Debug alert interval in minutes.
email_interval
integer
Interval between sending alert emails (1 - 99999 min).
emergency_interval
integer
Emergency alert interval in minutes.
error_interval
integer
Error alert interval in minutes.
FDS_license_expiring_days
integer
Number of days to send alert email prior to FortiGuard license expiration (1 - 100 days).
FDS_license_expiring_warning
string
    Choices:
  • enable
  • disable
Enable/disable FortiGuard license expiration warnings in alert email.
FDS_update_logs
string
    Choices:
  • enable
  • disable
Enable/disable FortiGuard update logs in alert email.
filter_mode
string
    Choices:
  • category
  • threshold
How to filter log messages that are sent to alert emails.
FIPS_CC_errors
string
    Choices:
  • enable
  • disable
Enable/disable FIPS and Common Criteria error logs in alert email.
firewall_authentication_failure_logs
string
    Choices:
  • enable
  • disable
Enable/disable firewall authentication failure logs in alert email.
fortiguard_log_quota_warning
string
    Choices:
  • enable
  • disable
Enable/disable FortiCloud log quota warnings in alert email.
FSSO_disconnect_logs
string
    Choices:
  • enable
  • disable
Enable/disable logging of FSSO collector agent disconnect.
HA_logs
string
    Choices:
  • enable
  • disable
Enable/disable HA logs in alert email.
information_interval
integer
Information alert interval in minutes.
IPS_logs
string
    Choices:
  • enable
  • disable
Enable/disable IPS logs in alert email.
IPsec_errors_logs
string
    Choices:
  • enable
  • disable
Enable/disable IPsec error logs in alert email.
local_disk_usage
integer
Disk usage percentage at which to send alert email (1 - 99 percent).
log_disk_usage_warning
string
    Choices:
  • enable
  • disable
Enable/disable disk usage warnings in alert email.
mailto1
string
Email address to send alert email to (usually a system administrator) (max. 64 characters).
mailto2
string
Optional second email address to send alert email to (max. 64 characters).
mailto3
string
Optional third email address to send alert email to (max. 64 characters).
notification_interval
integer
Notification alert interval in minutes.
PPP_errors_logs
string
    Choices:
  • enable
  • disable
Enable/disable PPP error logs in alert email.
severity
string
    Choices:
  • emergency
  • alert
  • critical
  • error
  • warning
  • notification
  • information
  • debug
Lowest severity level to log.
ssh_logs
string
    Choices:
  • enable
  • disable
Enable/disable SSH logs in alert email.
sslvpn_authentication_errors_logs
string
    Choices:
  • enable
  • disable
Enable/disable SSL-VPN authentication error logs in alert email.
username
string
Name that appears in the From: field of alert emails (max. 36 characters).
violation_traffic_logs
string
    Choices:
  • enable
  • disable
Enable/disable violation traffic logs in alert email.
warning_interval
integer
Warning alert interval in minutes.
webfilter_logs
string
    Choices:
  • enable
  • disable
Enable/disable web filter logs in alert email.
host
string
FortiOS or FortiGate IP address.
https
boolean
    Choices:
  • no
  • yes ←
Indicates if the requests towards FortiGate must use HTTPS protocol.
password
string
Default:
""
FortiOS or FortiGate password.
ssl_verify
boolean
    Choices:
  • no
  • yes ←
Ensures FortiGate certificate must be verified by a proper CA.
username
string
FortiOS or FortiGate username.
vdom
string
Default:
"root"
Virtual domain, among those defined previously. A vdom is a virtual instance of the FortiGate that can be configured and used as a different unit.

Notes

Note

  • Requires fortiosapi library developed by Fortinet

  • Run as a local_action in your playbook

Examples

- hosts: localhost
  vars:
   host: "192.168.122.40"
   username: "admin"
   password: ""
   vdom: "root"
   ssl_verify: "False"
  tasks:
  - name: Configure alert email settings.
    fortios_alertemail_setting:
      host:  "{{ host }}"
      username: "{{ username }}"
      password: "{{ password }}"
      vdom:  "{{ vdom }}"
      https: "False"
      alertemail_setting:
        admin_login_logs: "enable"
        alert_interval: "4"
        amc_interface_bypass_mode: "enable"
        antivirus_logs: "enable"
        configuration_changes_logs: "enable"
        critical_interval: "8"
        debug_interval: "9"
        email_interval: "10"
        emergency_interval: "11"
        error_interval: "12"
        FDS_license_expiring_days: "13"
        FDS_license_expiring_warning: "enable"
        FDS_update_logs: "enable"
        filter_mode: "category"
        FIPS_CC_errors: "enable"
        firewall_authentication_failure_logs: "enable"
        fortiguard_log_quota_warning: "enable"
        FSSO_disconnect_logs: "enable"
        HA_logs: "enable"
        information_interval: "22"
        IPS_logs: "enable"
        IPsec_errors_logs: "enable"
        local_disk_usage: "25"
        log_disk_usage_warning: "enable"
        mailto1: "<your_own_value>"
        mailto2: "<your_own_value>"
        mailto3: "<your_own_value>"
        notification_interval: "30"
        PPP_errors_logs: "enable"
        severity: "emergency"
        ssh_logs: "enable"
        sslvpn_authentication_errors_logs: "enable"
        username: "<your_own_value>"
        violation_traffic_logs: "enable"
        warning_interval: "37"
        webfilter_logs: "enable"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
build
string
always
Build number of the fortigate image

Sample:
1547
http_method
string
always
Last method used to provision the content into FortiGate

Sample:
PUT
http_status
string
always
Last result given by FortiGate on last operation applied

Sample:
200
mkey
string
success
Master key (id) used in the last call to FortiGate

Sample:
id
name
string
always
Name of the table used to fulfill the request

Sample:
urlfilter
path
string
always
Path of the table used to fulfill the request

Sample:
webfilter
revision
string
always
Internal revision number

Sample:
17.0.2.10658
serial
string
always
Serial number of the unit

Sample:
FGVMEVYYQT3AB5352
status
string
always
Indication of the operation's result

Sample:
success
vdom
string
always
Virtual domain used

Sample:
root
version
string
always
Version of the FortiGate

Sample:
v5.6.3


Status

Authors

  • Miguel Angel Munoz (@mamunozgonzalez)

  • Nicolas Thomas (@thomnico)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.