fortinet.fortios.fortios_system_alarm 模块 – 在 Fortinet 的 FortiOS 和 FortiGate 中配置警报。

注意

此模块是 fortinet.fortios 集合(版本 2.3.8)的一部分。

如果您使用的是 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install fortinet.fortios。您需要更多要求才能使用此模块,请参阅要求了解详细信息。

要在 playbook 中使用它,请指定:fortinet.fortios.fortios_system_alarm

fortinet.fortios 2.0.0 中的新增功能

概要

  • 此模块能够通过允许用户设置和修改系统功能和警报类别来配置 FortiGate 或 FortiOS (FOS) 设备。示例包括在使用前需要调整为数据源的所有参数和值。使用 FOS v6.0.0 进行测试

要求

执行此模块的主机需要满足以下要求。

  • ansible>=2.15

参数

参数

注释

access_token

字符串

基于令牌的身份验证。从 Fortigate 的 GUI 生成。

enable_log

布尔值

启用/禁用任务日志记录。

选项

  • false ← (默认)

  • true

member_path

字符串

要操作的成员属性路径。

如果有多个属性,则用斜杠字符分隔。

标记为 member_path 的参数对于执行成员操作是合法的。

member_state

字符串

在指定的属性路径下添加或删除成员。

指定 member_state 时,将忽略 state 选项。

选项

  • "present"

  • "absent"

system_alarm

字典

配置警报。

audible

字符串

启用/禁用声音警报。

选项

  • "enable"

  • "disable"

groups

列表 / elements=字典

警报组。

admin_auth_failure_threshold

整数

管理员身份验证失败阈值。

admin_auth_lockout_threshold

整数

管理员身份验证锁定阈值。

decryption_failure_threshold

整数

解密失败阈值。

encryption_failure_threshold

整数

加密失败阈值。

fw_policy_id

整数

防火墙策略 ID。

fw_policy_id_threshold

整数

防火墙策略 ID 阈值。

fw_policy_violations

列表 / elements=字典

防火墙策略违规。

dst_ip

字符串

目标 IP(0=全部)。

dst_port

整数

目标端口(0=全部)。

id

整数 / 必需

防火墙策略违规 ID。请参阅 <a href=’#notes’>注释</a>。

src_ip

字符串

源 IP(0=全部)。

src_port

整数

源端口(0=全部)。

threshold

整数

防火墙策略违规阈值。

id

整数 / 必需

组 ID。请参阅 <a href=’#notes’>注释</a>。

log_full_warning_threshold

整数

日志已满警告阈值。

period

整数

时间段,以秒为单位(0 = 从启动开始)。

replay_attempt_threshold

整数

重放尝试阈值。

self_test_failure_threshold

整数

自检失败阈值。

user_auth_failure_threshold

整数

用户身份验证失败阈值。

user_auth_lockout_threshold

整数

用户身份验证锁定阈值。

status

字符串

启用/禁用警报。

选项

  • "enable"

  • "disable"

vdom

字符串

虚拟域,在先前定义的那些之中。vdom 是 FortiGate 的虚拟实例,可以配置并用作不同的单元。

默认值: "root"

注释

注意

  • 旧版 fortiosapi 已被弃用,httpapi 是运行 playbook 的首选方式

示例

- name: Configure alarm.
  fortinet.fortios.fortios_system_alarm:
      vdom: "{{ vdom }}"
      system_alarm:
          audible: "enable"
          groups:
              -
                  admin_auth_failure_threshold: "0"
                  admin_auth_lockout_threshold: "0"
                  decryption_failure_threshold: "0"
                  encryption_failure_threshold: "0"
                  fw_policy_id: "0"
                  fw_policy_id_threshold: "0"
                  fw_policy_violations:
                      -
                          dst_ip: "<your_own_value>"
                          dst_port: "0"
                          id: "14"
                          src_ip: "<your_own_value>"
                          src_port: "0"
                          threshold: "0"
                  id: "18"
                  log_full_warning_threshold: "0"
                  period: "0"
                  replay_attempt_threshold: "0"
                  self_test_failure_threshold: "0"
                  user_auth_failure_threshold: "0"
                  user_auth_lockout_threshold: "0"
          status: "enable"

返回值

通用返回值记录在此处,以下是此模块独有的字段

描述

build

字符串

FortiGate 映像的版本号

返回值: 始终

示例: "1547"

http_method

字符串

上次用于将内容配置到 FortiGate 中的方法

返回值: 始终

示例: "PUT"

http_status

字符串

上次应用于 FortiGate 的操作的最终结果

返回值: 始终

示例: "200"

mkey

字符串

上次调用 FortiGate 时使用的主密钥 (id)

返回: 成功

示例: "id"

name

字符串

用于满足请求的表的名称

返回值: 始终

示例: "urlfilter"

path

字符串

用于满足请求的表的路径

返回值: 始终

示例: "webfilter"

revision

字符串

内部修订号

返回值: 始终

示例: "17.0.2.10658"

serial

字符串

设备的序列号

返回值: 始终

示例: "FGVMEVYYQT3AB5352"

status

字符串

操作结果的指示

返回值: 始终

示例: "success"

vdom

字符串

使用的虚拟域

返回值: 始终

示例: "root"

version

字符串

FortiGate 的版本

返回值: 始终

示例: "v5.6.3"

作者

  • Link Zheng (@chillancezen)

  • Jie Xue (@JieX19)

  • Hongbin Lu (@fgtdev-hblu)

  • Frank Shen (@frankshen01)

  • Miguel Angel Munoz (@mamunozgonzalez)

  • Nicolas Thomas (@thomnico)