cisco.ios.ios_logging_global 模块 – 用于配置日志记录的资源模块。

注意

此模块是 cisco.ios 集合(版本 9.0.3)的一部分。

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

要安装它,请使用:ansible-galaxy collection install cisco.ios

要在 playbook 中使用它,请指定:cisco.ios.ios_logging_global

cisco.ios 2.2.0 中的新增功能

概要

  • 此模块管理 Cisco IOS 网络设备的日志记录属性

参数

参数

注释

config

字典

日志记录选项的字典

buffered

字典

设置缓冲日志记录参数

discriminator

字符串

建立 MD-Buffer 关联

filtered

布尔值

启用筛选日志记录

选项

  • false

  • true

severity

字符串

日志记录严重级别

对于 ‘debugging’ 值,此属性不维护幂等性,因为此值未显示在 running-config 中。

选项

  • “alerts”

  • “critical”

  • “debugging”

  • “emergencies”

  • “errors”

  • “informational”

  • “notifications”

  • “warnings”

size

整数

日志缓冲区大小

xml

布尔值

启用以 XML 格式记录到 XML 日志缓冲区

选项

  • false

  • true

buginf

布尔值

启用 buginf 日志记录以进行调试

选项

  • false

  • true

cns_events

字符串

设置 CNS 事件日志记录级别

选项

  • “alerts”

  • “critical”

  • “debugging”

  • “emergencies”

  • “errors”

  • “informational”

  • “notifications”

  • “warnings”

console

字典

设置控制台日志记录参数

discriminator

字符串

建立 MD-Buffer 关联

filtered

布尔值

启用筛选日志记录

选项

  • false

  • true

severity

字符串

日志记录严重级别

选项

  • “alerts”

  • “critical”

  • “debugging”

  • “emergencies”

  • “errors”

  • “informational”

  • “notifications”

  • “warnings”

  • “guaranteed”

xml

布尔值

启用以 XML 格式记录到 XML 日志缓冲区

选项

  • false

  • true

count

布尔值

计数每个日志消息和时间戳上次出现的时间

选项

  • false

  • true

delimiter

字典

将分隔符附加到 syslog 消息

tcp

布尔值

将分隔符附加到通过 TCP 传输的 syslog 消息

选项

  • false

  • true

discriminator

列表 / 元素=字符串

创建或修改消息区分符

dmvpn

字典

DMVPN 配置

rate_limit

整数

以消息/分钟为单位的速率限制,默认值为 600 消息/分钟 (1-10000)

esm

字典

设置 ESM 过滤器限制

config

布尔值

允许/拒绝来自 ESM 过滤器的配置更改

选项

  • false

  • true

exception

整数

限制异常刷新输出的大小 (4096-2147483647)

facility

字符串

syslog 消息的设施参数

选项

  • “auth”

  • “cron”

  • “daemon”

  • “kern”

  • “local0”

  • “local1”

  • “local2”

  • “local3”

  • “local4”

  • “local5”

  • “local6”

  • “local7”

  • “lpr”

  • “mail”

  • “news”

  • “sys10”

  • “sys11”

  • “sys12”

  • “sys13”

  • “sys14”

  • “sys9”

  • “syslog”

  • “user”

  • “uucp”

filter

列表 / 元素=字典

指定日志筛选器

args

字符串

传递给筛选器模块的参数。

order

整数

筛选器执行顺序

url

字符串

筛选器统一资源定位符

history

字典

配置 syslog 历史记录表

severity

字符串

日志记录严重级别

对于 ‘debugging’ 值,此属性不维护幂等性,因为此值未显示在 running-config 中。

选项

  • “alerts”

  • “critical”

  • “debugging”

  • “emergencies”

  • “errors”

  • “informational”

  • “notifications”

  • “warnings”

size

整数

日志缓冲区大小

hosts

列表 / 元素=字典

设置 syslog 服务器 IP 地址和参数

discriminator

字符串

建立 MD-Buffer 关联

filtered

布尔值

启用筛选日志记录

选项

  • false

  • true

host

别名:hostname

字符串

syslog 服务器的 IP 地址

ipv6

字符串

配置 IPv6 syslog 服务器

sequence_num_session

布尔值

在 syslog 消息中包含会话序列号标签

选项

  • false

  • true

session_id

字典

指定 syslog 消息会话 ID 标记

tag

字符串

在会话 ID 标签中包含主机名

选项

  • “hostname”

  • “ipv4”

  • “ipv6”

text

字符串

在会话 ID 标签中包含自定义字符串

stream

整数

此服务器应仅接收来自编号流的消息

transport

字典

指定传输协议(默认值=UDP)

tcp

字典

传输控制协议

audit

布尔值

为此主机设置 IOS 防火墙审核日志记录

选项

  • false

  • true

discriminator

字符串

建立 MD-Buffer 关联

filtered

布尔值

启用筛选日志记录

选项

  • false

  • true

port

整数

指定 TCP 端口号(默认值=601)(1 - 65535)

sequence_num_session

布尔值

在 syslog 消息中包含会话序列号标签

选项

  • false

  • true

session_id

字典

指定 syslog 消息会话 ID 标记

tag

字符串

在会话 ID 标签中包含主机名

选项

  • “hostname”

  • “ipv4”

  • “ipv6”

text

字符串

在会话 ID 标签中包含自定义字符串

stream

整数

此服务器应仅接收来自编号流的消息

xml

布尔值

启用以 XML 格式记录到 XML 日志缓冲区

选项

  • false

  • true

udp

字典

用户数据报协议

discriminator

字符串

建立 MD-Buffer 关联

filtered

布尔值

启用筛选日志记录

选项

  • false

  • true

port

整数

指定 UDP 端口号(默认值=514)(1 - 65535)

sequence_num_session

布尔值

在 syslog 消息中包含会话序列号标签

选项

  • false

  • true

session_id

字典

指定 syslog 消息会话 ID 标记

tag

字符串

在会话 ID 标签中包含主机名

选项

  • “hostname”

  • “ipv4”

  • “ipv6”

text

字符串

在会话 ID 标签中包含自定义字符串

stream

整数

此服务器应仅接收来自编号流的消息

xml

布尔值

启用以 XML 格式记录到 XML 日志缓冲区

选项

  • false

  • true

vrf

字符串

设置 VRF 选项

xml

布尔值

启用以 XML 格式记录到 XML 日志缓冲区

选项

  • false

  • true

logging_on

字符串

启用对所有已启用目标的日志记录

选项

  • “enable”

  • “disable”

message_counter

列表 / 元素=字符串

配置日志消息以包含特定计数器值

选项

  • “log”

  • “debug”

  • “syslog”

monitor

字典

设置终端线路(监视器)日志记录参数

discriminator

字符串

建立 MD-Buffer 关联

filtered

布尔值

启用筛选日志记录

选项

  • false

  • true

severity

字符串

日志记录严重级别

对于 ‘debugging’ 值,此属性不维护幂等性,因为此值未显示在 running-config 中。

选项

  • “alerts”

  • “critical”

  • “debugging”

  • “emergencies”

  • “errors”

  • “informational”

  • “notifications”

  • “warnings”

xml

布尔值

启用以 XML 格式记录到 XML 日志缓冲区

选项

  • false

  • true

origin_id

字典

将源 ID 添加到 syslog 消息

tag

字符串

在会话 ID 标签中包含主机名

选项

  • “hostname”

  • “ip”

  • “ipv6”

text

字符串

在会话 ID 标签中包含自定义字符串

persistent

字典

设置持久日志记录参数

batch

整数

设置写入持久存储的批处理大小 (4096-2142715904)

filesize

整数

设置单个日志文件的大小 (4096-2142715904)

immediate

布尔值

立即将日志条目写入存储(不缓冲)。

选项

  • false

  • true

notify

布尔值

当 show logging [persistent] 激活时通知。

选项

  • false

  • true

protected

布尔值

消除对 logging-persistent 文件的操作。

选项

  • false

  • true

size

整数

设置用于写入日志消息的磁盘空间 (4096-2142715904)

threshold

整数

设置日志持久性的阈值

url

字符串

存储日志消息的 URL

policy_firewall

字典

防火墙配置

rate_limit

整数

(0-3600)以秒为单位的值,默认值为 30 秒。

queue_limit

字典

设置记录器消息队列大小

esm

整数

(100-2147483647)设置新的队列大小

size

整数

(100-2147483647)设置新的队列大小

trap

整数

(100-2147483647)设置新的队列大小

rate_limit

字典

设置每秒消息限制

all

布尔值

每秒 (1-10000) 条消息

选项

  • false

  • true

console

布尔值

每秒 (1-10000) 条消息

选项

  • false

  • true

except_severity

字符串

此严重性或更高的消息

选项

  • “alerts”

  • “critical”

  • “debugging”

  • “emergencies”

  • “errors”

  • “informational”

  • “notifications”

  • “warnings”

size

整数 / 必需

每秒 (1-10000) 条消息

reload

字典

设置重新加载日志记录级别

message_limit

整数

消息数量 (1-4294967295)

severity

字符串

日志记录严重级别

对于 ‘debugging’ 值,此属性不维护幂等性,因为此值未显示在 running-config 中。

选项

  • “alerts”

  • “critical”

  • “debugging”

  • “emergencies”

  • “errors”

  • “informational”

  • “notifications”

  • “warnings”

server_arp

布尔值

启用在首次配置时为 syslog 服务器发送 ARP 请求

选项

  • false

  • true

snmp_trap

列表 / 元素=字符串

设置用于发送 snmp trap 的 syslog 级别

选项

  • “alerts”

  • “critical”

  • “debugging”

  • “emergencies”

  • “errors”

  • “informational”

  • “notifications”

  • “warnings”

source_interface

列表 / 元素=字典

在日志记录事务中指定源地址的接口

interface

字符串

带编号的接口名称

vrf

字符串

VPN 路由/转发实例名称

trap

字符串

设置 syslog 服务器日志记录级别

选项

  • “alerts”

  • “critical”

  • “debugging”

  • “emergencies”

  • “errors”

  • “informational”

  • “notifications”

  • “warnings”

userinfo

布尔值

启用在启用特权模式时记录用户信息

选项

  • false

  • true

running_config

字符串

此选项仅与状态parsed一起使用。

此选项的值应该是执行命令 show running-config | include logging 从 IOS 设备收到的输出。

状态 parsedrunning_config 选项读取配置,并根据资源模块的 argspec 将其转换为 Ansible 结构化数据,然后该值将在结果中的 parsed 键中返回。

状态

字符串

配置应保持的状态

使用状态 replaced,对于运行配置中列出的日志配置,它们可以有多组命令,但如果不在任务中,则会被否定。

使用状态 overridden,运行配置中所有但不在任务中的配置都会被否定。

请参考示例了解更多详情。

选项

  • "merged" ← (默认)

  • "replaced"

  • "overridden"

  • "deleted"

  • "gathered"

  • "parsed"

  • "rendered"

注意

注意

示例

# Using state: merged

# Before state:
# -------------

# router-ios#show running-config | section logging
# no logging exception
# no logging buffered
# no logging reload
# no logging rate-limit
# no logging console
# no logging monitor
# no logging cns-events
# no logging trap

- name: Apply the provided configuration
  cisco.ios.ios_logging_global:
    config:
      buffered:
        severity: notifications
        size: 5099
        xml: true
      console:
        severity: critical
        xml: true
      facility: local5
      hosts:
        - hostname: 172.16.1.12
        - hostname: 172.16.1.11
          xml: true
        - hostname: 172.16.1.10
          filtered: true
          stream: 10
        - hostname: 172.16.1.13
          transport:
            tcp:
              port: 514
      monitor:
        severity: warnings
      message_counter: log
      snmp_trap:
        - errors
      trap: errors
      userinfo: true
      policy_firewall:
        rate_limit: 10
      logging_on: enable
      exception: 4099
      dmvpn:
        rate_limit: 10
      cns_events: warnings
    state: merged

# Commands Fired:
# ---------------

# "commands": [
#       "logging buffered xml 5099 notifications",
#       "logging cns-events warnings",
#       "logging console xml critical",
#       "logging dmvpn rate-limit 10",
#       "logging exception 4099",
#       "logging facility local5",
#       "logging monitor warnings",
#       "logging on",
#       "logging policy-firewall rate-limit 10",
#       "logging trap errors",
#       "logging userinfo",
#       "logging host 172.16.1.12",
#       "logging host 172.16.1.10 filtered stream 10",
#       "logging host 172.16.1.13 transport tcp port 514",
#       "logging message-counter log",
#       "logging snmp-trap errors",
#       "logging host 172.16.1.11 xml"
#     ],

# After state:
# ------------

# router-ios#show running-config | section logging
# logging exception 4099
# logging message-counter log
# logging userinfo
# logging buffered xml 5099 notifications
# no logging reload
# no logging rate-limit
# logging console xml critical
# logging monitor warnings
# logging cns-events warnings
# logging policy-firewall rate-limit 10
# logging dmvpn rate-limit 10
# logging trap errors
# logging facility local5
# logging snmp-trap errors
# logging snmp-trap warnings
# logging host 172.16.1.13 transport tcp port 514
# logging host 172.16.1.11 xml
# logging host 172.16.1.12
# logging host 172.16.1.10 filtered stream 10

# Using state: deleted

# Before state:
# -------------

# router-ios#show running-config | section logging
# logging exception 4099
# logging message-counter log
# logging userinfo
# logging buffered xml 5099 notifications
# no logging reload
# no logging rate-limit
# logging console xml critical
# logging monitor warnings
# logging cns-events warnings
# logging policy-firewall rate-limit 10
# logging dmvpn rate-limit 10
# logging trap errors
# logging facility local5
# logging snmp-trap errors
# logging host 172.16.1.13 transport tcp port 514
# logging host 172.16.1.11 xml
# logging host 172.16.1.12
# logging host 172.16.1.10 filtered stream 10

- name: Remove all existing configuration
  cisco.ios.ios_logging_global:
    state: deleted

# Commands Fired:
# ---------------

# "commands": [
#       "no logging message-counter log",
#       "no logging snmp-trap errors",
#       "no logging host 172.16.1.13",
#       "no logging host 172.16.1.11",
#       "no logging host 172.16.1.12",
#       "no logging host 172.16.1.10",
#       "no logging exception 4099",
#       "no logging userinfo",
#       "no logging buffered xml 5099 notifications",
#       "no logging console xml critical",
#       "no logging monitor warnings",
#       "no logging cns-events warnings",
#       "no logging policy-firewall rate-limit 10",
#       "no logging dmvpn rate-limit 10",
#       "no logging trap errors",
#       "no logging facility local5"
#     ],

# After state:
# ------------

# router-ios#show running-config | section logging
# no logging exception
# no logging buffered
# no logging reload
# no logging rate-limit
# no logging console
# no logging monitor
# no logging cns-events
# no logging trap

# Using state: overridden

# Before state:
# -------------

# router-ios#show running-config | section logging
# logging exception 4099
# logging message-counter log
# logging userinfo
# logging buffered 6000 critical
# no logging reload
# no logging rate-limit
# logging console xml critical
# logging monitor warnings
# logging cns-events warnings
# logging policy-firewall rate-limit 10
# logging dmvpn rate-limit 10
# logging trap errors
# logging facility local6
# logging host 172.16.1.13 transport tcp port 514
# logging host 172.16.1.12
# logging host 172.16.1.10 filtered stream 10
# logging host 172.16.1.25 filtered

- name: Override commands with provided configuration
  cisco.ios.ios_logging_global:
    config:
      hosts:
        - hostname: 172.16.1.27
          filtered: true
    state: overridden

# Commands Fired:
# ---------------
# "commands": [
#         "no logging message-counter log",
#         "no logging host 172.16.1.12",
#         "no logging host 172.16.1.10",
#         "no logging host 172.16.1.13",
#         "no logging exception 4099",
#         "no logging userinfo",
#         "no logging console xml critical",
#         "no logging monitor warnings",
#         "no logging cns-events warnings",
#         "no logging policy-firewall rate-limit 10",
#         "no logging dmvpn rate-limit 10",
#         "no logging trap errors",
#         "no logging buffered 6000 critical",
#         "no logging facility local6",
#         "logging host 172.16.1.27 filtered",
#     ],

# After state:
# ------------

# router-ios#show running-config | section logging
# no logging exception
# no logging buffered
# no logging reload
# no logging rate-limit
# no logging console
# no logging monitor
# no logging cns-events
# no logging trap
# logging host 172.16.1.27 filtered

# Using state: replaced

# Before state:
# -------------

# router-ios#show running-config | section logging
# logging exception 4099
# logging message-counter log
# logging userinfo
# logging buffered xml 5099 notifications
# no logging reload
# no logging rate-limit
# logging console xml critical
# logging monitor warnings
# logging cns-events warnings
# logging policy-firewall rate-limit 10
# logging dmvpn rate-limit 10
# logging trap errors
# logging facility local5
# logging snmp-trap errors
# logging host 172.16.1.13 transport tcp port 514
# logging host 172.16.1.11 xml
# logging host 172.16.1.12
# logging host 172.16.1.10 filtered stream 10

- name: Replace commands with provided configuration
  cisco.ios.ios_logging_global:
    config:
      buffered:
        severity: alerts
        size: 6025
      facility: local6
      hosts:
        - hostname: 172.16.1.19
        - hostname: 172.16.1.10
          filtered: true
          stream: 15
    state: replaced

# Commands Fired:
# ---------------

# "commands": [
#         "no logging host 172.16.1.13",
#         "no logging host 172.16.1.11",
#         "no logging host 172.16.1.12",
#         "no logging host 172.16.1.10",
#         "logging host 172.16.1.19",
#         "logging host 172.16.1.10 filtered stream 15",
#         "logging buffered 6025 alerts",
#         "logging facility local6"
#     ],

# After state:
# ------------

# router-ios#show running-config | section logging
# logging exception 4099
# logging message-counter log
# logging userinfo
# logging buffered 6025 alerts
# no logging reload
# no logging rate-limit
# logging console xml critical
# logging monitor warnings
# logging cns-events warnings
# logging policy-firewall rate-limit 10
# logging dmvpn rate-limit 10
# logging trap errors
# logging facility local6
# logging snmp-trap errors
# logging host 172.16.1.19

# Using state: gathered

# Before state:
# -------------

# router-ios#show running-config | section logging
# logging exception 4099
# logging message-counter log
# logging userinfo
# logging buffered xml 5099 notifications
# no logging reload
# no logging rate-limit
# logging console xml critical
# logging monitor warnings
# logging cns-events warnings
# logging policy-firewall rate-limit 10
# logging dmvpn rate-limit 10
# logging trap errors
# logging facility local5
# logging snmp-trap errors
# logging host 172.16.1.13 transport tcp port 514
# logging host 172.16.1.11 xml
# logging host 172.16.1.12
# logging host 172.16.1.10 filtered stream 10
# logging host 172.16.1.25 filtered

- name: Gather listed logging config
  cisco.ios.ios_logging_global:
    state: gathered

# Module Execution Result:
# ------------------------

# "gathered": {
#     "buffered": {
#         "severity": "notifications",
#         "size": 5099,
#         "xml": true
#     },
#     "cns_events": "warnings",
#     "console": {
#         "severity": "critical",
#         "xml": true
#     },
#     "dmvpn": {
#         "rate_limit": 10
#     },
#     "exception": 4099,
#     "facility": "local5",
#     "hosts": [
#         {
#             "hostname": "172.16.1.11",
#             "xml": true
#         },
#         {
#             "hostname": "172.16.1.12"
#         },
#         {
#             "filtered": true,
#             "hostname": "172.16.1.10",
#             "stream": 10
#         },
#         {
#             "hostname": "172.16.1.13",
#             "transport": {
#                 "tcp": {
#                     "port": 514
#                 }
#             }
#         },
#         {
#             "filtered": true,
#             "hostname": "172.16.1.25"
#         }
#     ],
#     "message_counter": [
#         "log"
#     ],
#     "monitor": {
#         "severity": "warnings"
#     },
#     "policy_firewall": {
#         "rate_limit": 10
#     },
#     "snmp_trap": [
#         "errors"
#     ],
#     "trap": "errors",
#     "userinfo": true
# },

# After state:
# -------------

# router-ios#show running-config | section logging
# logging exception 4099
# logging message-counter log
# logging userinfo
# logging buffered xml 5099 notifications
# no logging reload
# no logging rate-limit
# logging console xml critical
# logging monitor warnings
# logging cns-events warnings
# logging policy-firewall rate-limit 10
# logging dmvpn rate-limit 10
# logging trap errors
# logging facility local5
# logging snmp-trap errors
# logging host 172.16.1.13 transport tcp port 514
# logging host 172.16.1.11 xml
# logging host 172.16.1.12
# logging host 172.16.1.10 filtered stream 10
# logging host 172.16.1.25 filtered

# Using state: rendered

- name: Render the commands for provided configuration
  cisco.ios.ios_logging_global:
    config:
      buffered:
        severity: notifications
        size: 5099
        xml: true
      console:
        severity: critical
        xml: true
      facility: local5
      hosts:
        - hostname: 172.16.1.12
        - hostname: 172.16.1.11
          xml: true
        - hostname: 172.16.1.10
          filtered: true
          stream: 10
        - hostname: 172.16.1.13
          transport:
            tcp:
              port: 514
      monitor:
        severity: warnings
      message_counter: log
      snmp_trap: errors
      trap: errors
      userinfo: true
      policy_firewall:
        rate_limit: 10
      logging_on: enable
      exception: 10
      dmvpn:
        rate_limit: 10
      cns_events: warnings
    state: rendered

# Module Execution Result:
# ------------------------

# "rendered": [
#     "logging host 172.16.1.12",
#     "logging host 172.16.1.11 xml",
#     "logging host 172.16.1.10 filtered stream 10",
#     "logging host 172.16.1.13 transport tcp port 514",
#     "logging message-counter log",
#     "logging snmp-trap errors",
#     "logging buffered xml 5099 notifications",
#     "logging console xml critical",
#     "logging facility local5",
#     "logging monitor warnings",
#     "logging trap errors",
#     "logging userinfo",
#     "logging policy-firewall rate-limit 10",
#     "logging on",
#     "logging exception 10",
#     "logging dmvpn rate-limit 10",
#     "logging cns-events warnings"
#     ]

# Using state: parsed

# File: parsed.cfg
# ----------------

# logging on
# logging count
# logging userinfo
# logging trap errors
# logging reload alerts
# logging host 172.16.1.1
# logging exception 4099
# logging history alerts
# logging facility local5
# logging snmp-trap errors
# logging monitor warnings
# logging origin-id hostname
# logging host 172.16.1.11 xml
# logging cns-events warnings
# logging dmvpn rate-limit 10
# logging message-counter log
# logging console xml critical
# logging message-counter debug
# logging persistent batch 4444
# logging host 172.16.1.25 filtered
# logging source-interface GBit1/0
# logging source-interface CTunnel2
# logging policy-firewall rate-limit 10
# logging buffered xml 5099 notifications
# logging rate-limit all 2 except warnings
# logging host 172.16.1.10 filtered stream 10
# logging host 172.16.1.13 transport tcp port 514
# logging discriminator msglog01 severity includes 5
# logging filter tftp://172.16.2.18/ESM/elate.tcl args TESTInst2
# logging filter tftp://172.16.2.14/ESM/escalate.tcl args TESTInst

- name: Parse the provided configuration with the existing running configuration
  cisco.ios.ios_logging_global:
    running_config: "{{ lookup('file', 'parsed.cfg') }}"
    state: parsed

# Module Execution Result:
# ------------------------

# "parsed": {
#     "buffered": {
#         "severity": "notifications",
#         "size": 5099,
#         "xml": true
#     },
#     "cns_events": "warnings",
#     "console": {
#         "severity": "critical",
#         "xml": true
#     },
#     "count": true,
#     "discriminator": [
#         "msglog01 severity includes 5"
#     ],
#     "dmvpn": {
#         "rate_limit": 10
#     },
#     "exception": 4099,
#     "facility": "local5",
#     "filter": [
#         {
#             "args": "TESTInst2",
#             "url": "tftp://172.16.2.18/ESM/elate.tcl"
#         },
#         {
#             "args": "TESTInst",
#             "url": "tftp://172.16.2.14/ESM/escalate.tcl"
#         }
#     ],
#     "history": {
#         "severity": "alerts"
#     },
#     "hosts": [
#         {
#             "hostname": "172.16.1.1"
#         },
#         {
#             "hostname": "172.16.1.11",
#             "xml": true
#         },
#         {
#             "filtered": true,
#             "hostname": "172.16.1.25"
#         },
#         {
#             "filtered": true,
#             "hostname": "172.16.1.10",
#             "stream": 10
#         },
#         {
#             "hostname": "172.16.1.13",
#             "transport": {
#                 "tcp": {
#                     "port": 514
#                 }
#             }
#         }
#     ],
#     "logging_on": "enable",
#     "message_counter": [
#         "log",
#         "debug"
#     ],
#     "monitor": {
#         "severity": "warnings"
#     },
#     "origin_id": {
#         "tag": "hostname"
#     },
#     "persistent": {
#         "batch": 4444
#     },
#     "policy_firewall": {
#         "rate_limit": 10
#     },
#     "rate_limit": {
#         "all": true,
#         "except_severity": "warnings",
#         "size": 2
#     },
#     "reload": {
#         "severity": "alerts"
#     },
#     "snmp_trap": [
#         "errors"
#     ],
#     "source_interface": [
#         {
#             "interface": "GBit1/0"
#         },
#         {
#             "interface": "CTunnel2"
#         }
#     ],
#     "trap": "errors",
#     "userinfo": true
# }

返回值

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

描述

after

字典

生成的配置模型调用。

返回: 当发生更改时

示例: "返回的配置将始终与上述参数的格式相同。\n"

before

字典

模型调用之前的配置。

返回: 始终

示例: "返回的配置将始终与上述参数的格式相同。\n"

commands

列表 / 元素=字符串

推送到远程设备的命令集。

返回: 始终

示例: ["logging on", "logging userinfo", "logging trap errors", "logging host 172.16.1.12", "logging console xml critical", "logging message-counter log", "logging policy-firewall rate-limit 10"]

作者

  • Sagar Paul (@KB-perByte)