fortinet.fortios.fortios_monitor 模块 – 用于 FortiOS Monitor API 的 Ansible 模块

注意

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

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

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

要在剧本中使用它,请指定:fortinet.fortios.fortios_monitor

fortinet.fortios 2.0.0 中的新增功能

概要

  • 请求 FortiOS 设备执行特定操作或过程。此模块包含所有 FortiOS Monitor API。

要求

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

  • 安装 Galaxy 集合 fortinet.fortios >= 2.0.0。

参数

参数

注释

access_token

字符串

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

enable_log

布尔值

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

选项

  • false ← (默认)

  • true

params

字典

每个选择器的参数,请参见上表中的定义。

selector

字符串 / 必需

检索到的 fortimanager facts 的选择器

选项

  • "check.endpoint-control.registration-password"

  • "quarantine.endpoint-control.registration"

  • "unquarantine.endpoint-control.registration"

  • "block.endpoint-control.registration"

  • "unblock.endpoint-control.registration"

  • "deregister.endpoint-control.registration"

  • "clear_counters.firewall.acl"

  • "clear_counters.firewall.acl6"

  • "reset.firewall.policy"

  • "clear_counters.firewall.policy"

  • "reset.firewall.policy6"

  • "clear_counters.firewall.policy6"

  • "clear_counters.firewall.proxy-policy"

  • "clear_all.firewall.session"

  • "close.firewall.session"

  • "reset.firewall.shaper"

  • "reset.firewall.per-ip-shaper"

  • "cancel.fortiview.session"

  • "upgrade.license.database"

  • "reset.log.stats"

  • "login.registration.forticloud"

  • "create.registration.forticloud"

  • "logout.registration.forticloud"

  • "login.registration.forticare"

  • "create.registration.forticare"

  • "add-license.registration.forticare"

  • "add-license.registration.vdom"

  • "toggle-vdom-mode.system.admin"

  • "generate-key.system.api-user"

  • "update-comments.system.config-revision"

  • "delete.system.config-revision"

  • "save.system.config-revision"

  • "system.disconnect-admins"

  • "set.system.time"

  • "reboot.system.os"

  • "shutdown.system.os"

  • "revoke.system.dhcp"

  • "revoke.system.dhcp6"

  • "upgrade.system.firmware"

  • "start.system.fsck"

  • "system.change-password"

  • "system.password-policy-conform"

  • "reset.system.modem"

  • "connect.system.modem"

  • "disconnect.system.modem"

  • "update.system.modem"

  • "restart.system.sniffer"

  • "start.system.sniffer"

  • "stop.system.sniffer"

  • "test.system.automation-stitch"

  • "update.switch-controller.managed-switch"

  • "restart.switch-controller.managed-switch"

  • "poe-reset.switch-controller.managed-switch"

  • "factory-reset.switch-controller.managed-switch"

  • "download.switch-controller.fsw-firmware"

  • "push.switch-controller.fsw-firmware"

  • "upload.switch-controller.fsw-firmware"

  • "dhcp-renew.system.interface"

  • "start.system.usb-log"

  • "stop.system.usb-log"

  • "eject.system.usb-device"

  • "update.system.fortiguard"

  • "clear-statistics.system.fortiguard"

  • "test-availability.system.fortiguard"

  • "config.system.fortimanager"

  • "backup-action.system.fortimanager"

  • "dump.system.com-log"

  • "update.system.ha-peer"

  • "disconnect.system.ha-peer"

  • "run.system.compliance"

  • "restore.system.config"

  • "upload.system.vmlicense"

  • "trigger.system.security-rating"

  • "reset.extender-controller.extender"

  • "validate-gcp-key.system.sdn-connector"

  • "deauth.user.firewall"

  • "clear_users.user.banned"

  • "add_users.user.banned"

  • "clear_all.user.banned"

  • "activate.user.fortitoken"

  • "refresh.user.fortitoken"

  • "provision.user.fortitoken"

  • "send-activation.user.fortitoken"

  • "import-trial.user.fortitoken"

  • "import-mobile.user.fortitoken"

  • "import-seed.user.fortitoken"

  • "refresh-server.user.fsso"

  • "test-connect.user.radius"

  • "test.user.tacacs-plus"

  • "delete.webfilter.override"

  • "reset.webfilter.category-quota"

  • "tunnel_up.vpn.ipsec"

  • "tunnel_down.vpn.ipsec"

  • "tunnel_reset_stats.vpn.ipsec"

  • "clear_tunnel.vpn.ssl"

  • "delete.vpn.ssl"

  • "import.vpn-certificate.ca"

  • "import.vpn-certificate.crl"

  • "import.vpn-certificate.local"

  • "import.vpn-certificate.remote"

  • "generate.vpn-certificate.csr"

  • "reset.wanopt.history"

  • "reset.wanopt.webcache"

  • "reset.wanopt.peer_stats"

  • "reset.webcache.stats"

  • "set_status.wifi.managed_ap"

  • "download.wifi.firmware"

  • "push.wifi.firmware"

  • "upload.wifi.firmware"

  • "restart.wifi.managed_ap"

  • "reset.wifi.euclid"

  • "clear_all.wifi.rogue_ap"

  • "set_status.wifi.rogue_ap"

  • "reset.firewall.consolidated-policy"

  • "clear_counters.firewall.consolidated-policy"

  • "clear_counters.firewall.security-policy"

  • "add.firewall.clearpass-address"

  • "delete.firewall.clearpass-address"

  • "delete.log.local-report"

  • "migrate.registration.forticloud"

  • "change-vdom-mode.system.admin"

  • "delete.system.config-script"

  • "run.system.config-script"

  • "upload.system.config-script"

  • "diagnose.extender-controller.extender"

  • "upgrade.extender-controller.extender"

  • "add.nsx.service"

  • "update.system.sdn-connector"

  • "import.web-ui.language"

  • "create.web-ui.custom-language"

  • "update.web-ui.custom-language"

  • "email.user.guest"

  • "sms.user.guest"

  • "utm.rating-lookup"

  • "connect.wifi.network"

  • "scan.wifi.network"

  • "upload.wifi.region-image"

  • "refresh.azure.application-list"

  • "verify-cert.endpoint-control.ems"

  • "geoip.geoip-query"

  • "transfer.registration.forticare"

  • "register-device.registration.forticloud"

  • "register-appliance.system.csf"

  • "clear.system.sniffer"

  • "webhook.system.automation-stitch"

  • "format.system.logdisk"

  • "speed-test-trigger.system.interface"

  • "read-info.system.certificate"

  • "provision-user.vpn.ssl"

  • "upload.webproxy.pacfile"

  • "disassociate.wifi.client"

  • "start.wifi.spectrum"

  • "keep-alive.wifi.spectrum"

  • "stop.wifi.spectrum"

  • "start.wifi.vlan-probe"

  • "stop.wifi.vlan-probe"

  • "generate-keys.wifi.ssid"

  • "save.system.config"

  • "led-blink.wifi.managed_ap"

  • "auth.user.firewall"

  • "remove.user.device"

  • "clear.vpn.ike"

  • "reset.firewall.multicast-policy"

  • "reset.firewall.multicast-policy6"

  • "clear_counters.firewall.multicast-policy"

  • "clear_counters.firewall.multicast-policy6"

  • "clear-soft-in.router.bgp"

  • "clear-soft-out.router.bgp"

  • "enable-app-bandwidth-tracking.system.traffic-history"

  • "refresh.system.external-resource"

  • "reset.firewall.central-snat-map"

  • "clear-counters.firewall.central-snat-map"

  • "reset.firewall.dnat"

  • "clear-counters.firewall.dnat"

  • "close-multiple.firewall.session"

  • "close-multiple.firewall.session6"

  • "close-all.firewall.session"

  • "clear.system.crash-log"

  • "backup.system.config"

  • "abort.user.query"

  • "create.vpn-certificate.local"

  • "flush.firewall.gtp"

  • "kill.system.process"

  • "upload.system.hscalefw-license"

  • "download.system.vmlicense"

  • "start.network.debug-flow"

  • "stop.network.debug-flow"

  • "upload.system.lte-modem"

  • "upgrade.system.lte-modem"

  • "port-stats-reset.switch-controller.managed-switch"

  • "bounce-port.switch-controller.managed-switch"

  • "set-tier1.switch-controller.mclag-icl"

  • "wake-on-lan.system.interface"

  • "manual-update.system.fortiguard"

  • "purdue-level.user.device"

  • "deregister-device.registration.forticare"

  • "soft-reset-neighbor.router.bgp"

  • "download-eval.system.vmlicense"

  • "dynamic.system.external-resource"

  • “pse-config.switch-controller.recommendation”

  • “update.switch-controller.isl-lockdown”

  • “clear-counters.firewall.ztna-firewall-policy”

  • “update.forticonverter.eligibility”

  • “create.forticonverter.ticket”

  • “update.forticonverter.sn-list”

  • “upload.forticonverter.config”

  • “update.forticonverter.intf-list”

  • “forticonverter.set-source-sn”

  • “submit.forticonverter.intf-mapping”

  • “submit.forticonverter.mgmt-intf”

  • “submit.forticonverter.notes”

  • “submit.forticonverter.ticket”

  • “update.forticonverter.submitted-info”

  • “start.forticonverter.download”

  • “trial.user.fortitoken-cloud”

  • “unverify-cert.endpoint-control.ems”

  • “update-global-label.firewall.policy”

  • “update-global-label.firewall.security-policy”

  • “set-tier-plus.switch-controller.mclag-icl”

  • “user.password-policy-conform”

  • “change-password.user.local”

  • “report.sdwan.link-monitor-metrics”

vdom

字符串

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

默认值: "root"

备注

注意

  • 不同的选择器可能具有不同的参数,用户应查找特定选择器的参数。

  • 对于某些选择器,对象是全局的,不允许出现参数。

  • 并非所有参数对于选择器都是必需的。

  • 此模块专用于FortiOS监控API。

  • API请求的结果存储在results中。

示例

- name: Activate FortiToken
  fortinet.fortios.fortios_monitor:
      vdom: "root"
      access_token: "your_own_value"
      selector: 'activate.user.fortitoken'
      params:
          tokens: '<token string>'

- name: Reboot This Device
  fortinet.fortios.fortios_monitor:
      vdom: "root"
      access_token: "you_own_value"
      selector: 'reboot.system.os'
      params:
          event_log_message: 'Reboot Request From Ansible'

返回值

公共返回值已在此处记录,以下是此模块特有的字段

描述

build

字符串

FortiGate镜像的版本号

返回值:始终

示例: "1547"

http_method

字符串

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

返回值:始终

示例: "GET"

name

字符串

用于完成请求的表的名称

返回值:始终

示例: "firmware"

path

字符串

用于完成请求的表的路径

返回值:始终

示例: "system"

revision

字符串

内部版本号

返回值:始终

示例: "17.0.2.10658"

serial

字符串

设备的序列号

返回值:始终

示例: "FGVMEVYYQT3AB5352"

status

字符串

操作结果指示

返回值:始终

示例: "success"

vdom

字符串

使用的虚拟域

返回值:始终

示例: "root"

version

字符串

FortiGate的版本

返回值:始终

示例: "v5.6.3"

作者

  • 薛杰 (@JieX19)

  • 郑链 (@chillancezen)

  • 陆洪斌 (@fgtdev-hblu)

  • 沈方 (@fshen01)