arista.eos.eos_snmp_server 模块 – 管理 snmp_server 资源模块
注意
此模块是 arista.eos 集合 (版本 10.0.1) 的一部分。
如果您正在使用 ansible
包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install arista.eos
。
要在剧本中使用它,请指定: arista.eos.eos_snmp_server
。
arista.eos 3.2.0 中的新增功能
概要
此模块配置和管理 Arista EOS 平台上 snmp_server 的属性。
参数
参数 |
注释 |
---|---|
SNMP 服务器配置。 |
|
IPv4/IPv6 访问列表 |
|
acl 名称 |
|
ipv4/ipv6 选项
|
|
vrf 名称 |
|
SNMP 底盘标识符。 |
|
社区名称配置。 |
|
标准访问列表名称 |
|
IPv6 访问列表名称。 |
|
社区名称 |
|
仅允许读取。 选项
|
|
读写访问 选项
|
|
MIB 视图名称 |
|
联系系统的人员。 |
|
SNMPv3 引擎 ID 配置。 |
|
本地 SNMP 代理 |
|
远程 SNMP 代理 |
|
远程 SNMP 通知主机的 hostname 或 IP 地址 |
|
引擎 ID 八位字节字符串 |
|
远程 SNMP 通知主机的 UDP 端口号。 |
|
配置扩展脚本以服务 OID 范围 |
|
使用低效的 one_shot 接口 选项
|
|
扩展根 OID |
|
脚本位置 |
|
SNMP USM 组 |
|
身份验证和隐私配置。当 version = v3 时有效。 选项
|
|
指定与组关联的上下文 |
|
用户的 SNMP 组 |
|
限制通知的视图 |
|
限制读取访问的视图 |
|
snmp 安全组版本 选项
|
|
限制写入访问的视图 |
|
通知目标 |
|
SNMP 通知主机的 hostname 或 IP 地址。 |
|
使用 SNMP inform 消息。 选项
|
|
使用 SNMP trap 消息 选项
|
|
通知消息的 UDP 目的端口。 |
|
社区或用户名。 |
|
通知消息 SNMP 版本。 选项
|
|
指定配置主机的 VRF |
|
配置 SNMP 通知的消息源接口。 |
|
sysLocation 字符串。 |
|
日志中通知的最大数量 |
|
为 true 时禁用一组对象的实现 |
|
dot1dTpFdbTable, dot1qTpFdbTable 选项
|
|
ipCidrRouteTable, ipCidrRouteNumber, aristaFIBStats* 选项
|
|
配置 QoS 参数。 |
|
设置 QOS_MIB 计数器更新间隔 |
|
SNMP 消息中的最大字节数(UDP/TCP 负载) |
|
启用 snmpd 传输层协议 |
|
启用对所有已配置接收者的陷阱。 |
|
启用 Bgp 陷阱。如果设置为启用,则所有陷阱都将设置。 |
|
arista_backward_transition 选项
|
|
arista_established 选项
|
|
backward_transition 选项
|
|
所有陷阱都已设置。 选项
|
|
已建立。 选项
|
|
启用 Bridge 陷阱。如果设置为启用,则所有陷阱都将设置。 |
|
arista_mac_age 选项
|
|
arista_mac_learn 选项
|
|
arista_mac_move 选项
|
|
所有陷阱都已设置。 选项
|
|
启用 Capacity 陷阱。如果设置为启用,则所有陷阱都将设置。 |
|
arista_hardware_utilization_alert 选项
|
|
所有陷阱都已设置。 选项
|
|
启用 Entity 陷阱。如果设置为启用,则所有陷阱都将设置。 |
|
arista_ent_sensor_alarm 选项
|
|
所有陷阱都已设置。 选项
|
|
ent_config_change 选项
|
|
ent_state_oper 选项
|
|
ent_state_oper_disabled。 选项
|
|
ent_state_oper_enabled。 选项
|
|
启用外部警报陷阱。如果设置为启用,则所有陷阱都将设置。 |
|
arista_external_alarm_asserted_notif 选项
|
|
arista_external_alarm_deasserted_notif 选项
|
|
所有陷阱都已设置。 选项
|
|
启用 isis 陷阱。如果设置为启用,则所有陷阱都将设置。 |
|
adjacency_change 选项
|
|
area_mismatch 选项
|
|
attempt_to_exceed_max_sequence 选项
|
|
authentication_type_failure。 选项
|
|
database_overload 选项
|
|
所有陷阱都已设置。 选项
|
|
own_lsp_purge 选项
|
|
rejected_adjacency 选项
|
|
sequence_number_skip。 选项
|
|
启用 Lldp 陷阱。如果设置为启用,则所有陷阱都将设置。 |
|
所有陷阱都已设置。 选项
|
|
rem_tables_change 选项
|
|
启用 mpls_ldp 陷阱。如果设置为启用,则所有陷阱都将设置。 |
|
所有陷阱都已设置。 选项
|
|
mpls_ldp_session_down 选项
|
|
mpls_ldp_session_up 选项
|
|
启用 msdp 陷阱。如果设置为启用,则所有陷阱都将设置。 |
|
backward_transition。 选项
|
|
所有陷阱都已设置。 选项
|
|
已建立。 选项
|
|
启用 OSPF 陷阱。如果设置为启用,则设置所有陷阱。 |
|
所有陷阱都已设置。 选项
|
|
if_auth_failure 选项
|
|
if_config_error 选项
|
|
if_state_change 选项
|
|
nbr_state_change。 选项
|
|
启用 OSPFv3 陷阱。如果设置为启用,则设置所有陷阱。 |
|
所有陷阱都已设置。 选项
|
|
if_config_error 选项
|
|
if_rx_bad_packet 选项
|
|
if_state_change 选项
|
|
启用 ospfv3NbrRestartHelperStatusChange 陷阱 选项
|
|
nbr_state_change。 选项
|
|
启用 ospfv3NssaTranslatorStatusChange 陷阱 选项
|
|
restart_status_change 选项
|
|
启用 PIM 陷阱。如果设置为启用,则设置所有陷阱。 |
|
所有陷阱都已设置。 选项
|
|
neighbor_loss 选项
|
|
启用 SNMP 陷阱。如果设置为启用,则设置所有陷阱。 |
|
authentication 选项
|
|
所有陷阱都已设置。 选项
|
|
link_down 选项
|
|
link_up 选项
|
|
启用 snmpConfigManEvent 陷阱。如果设置为启用,则设置所有陷阱。 |
|
arista_config_man_event 选项
|
|
所有陷阱都已设置。 选项
|
|
启用切换陷阱。如果设置为启用,则设置所有陷阱。 |
|
arista_redundancy_switch_over_notif 选项
|
|
所有陷阱都已设置。 选项
|
|
启用测试陷阱。如果设置为启用,则设置所有陷阱。 |
|
arista_test_notification 选项
|
|
所有陷阱都已设置。 选项
|
|
启用 VRRP 陷阱。如果设置为启用,则设置所有陷阱。 |
|
所有陷阱都已设置。 选项
|
|
vrrp 选项
|
|
SNMP 用户配置。 |
|
用户身份验证设置 |
|
身份验证算法 |
|
身份验证密码十六进制字符串 |
|
加密算法。 |
|
隐私密码十六进制字符串 |
|
用户的 SNMP 组。 |
|
本地化身份验证和隐私密码。 |
|
身份验证算法 |
|
身份验证密码十六进制字符串 |
|
加密算法。 |
|
引擎ID |
|
隐私密码十六进制字符串 |
|
托管 SNMPv3 用户的系统 |
|
远程 SNMP 系统使用的 UDP 端口 |
|
SNMP 用户名 |
|
SNMP 安全版本 选项
|
|
SNMPv2 MIB 视图配置 |
|
要执行的操作。 选项
|
|
SNMP MIB 名称 |
|
SNMP 视图名称 |
|
指定使用源地址的 VRF |
|
配置 SNMP 通知源接口 |
|
VRF 名称。 |
|
此选项仅与状态 *parsed* 一起使用。 此选项的值应为通过执行命令 **show running-config | section snmp-server** 从 EOS 设备接收到的输出。 状态 *parsed* 从 |
|
配置应保留的状态。 对于此模块,状态 *replaced* 和 *overridden* 的行为相同。 请参阅示例了解更多详情。 选项
|
注释
注意
针对 Arista EOS 4.24.6F 测试
此模块可与连接
network_cli
和httpapi
一起使用。
示例
# Using merged:
# Before State
# eos#show running-config | section snmp-server
# eos#
- name: merge given snmp_server configuration
arista.eos.eos_snmp_server:
config:
communities:
- name: "comm3"
acl_v6: "list1"
view: "view1"
- name: "comm4"
acl_v4: "list3"
view: "view1"
- name: "comm5"
acl_v4: "list4"
ro: true
contact: "admin"
engineid:
remote:
host: 1.1.1.1
id: "1234567"
groups:
- group: "group1"
version: "v1"
read: "view1"
- group: "group2"
version: "v3"
auth_privacy: "priv"
notify: "view1"
write: "view2"
hosts:
- host: "host02"
user: "user01"
udp_port: 23
version: "2c"
- host: "host01"
user: "user01"
udp_port: 23
version: "3 priv"
traps:
capacity:
arista_hardware_utilization_alert: true
bgp:
enabled: true
external_alarm:
arista_external_alarm_deasserted_notif: true
arista_external_alarm_asserted_notif: true
vrfs:
- vrf: "vrf01"
local_interface: "Ethernet1"
# After state
# eos#show running-config | section snmp-server
# snmp-server community comm3 view view1 ipv6 list1
# snmp-server community comm4 view view1 list3
# snmp-server community comm5 ro list4
# snmp-server group group1 v1 read view1
# snmp-server group group2 v3 priv write view2 notify view1
# snmp-server host host02 version 2c user01 udp-port 23
# snmp-server host host01 version 3 priv user01 udp-port 23
# snmp-server vrf vrf01 local-interface Ethernet1
# snmp-server contact admin
# snmp-server enable traps bgp
# snmp-server enable traps capacity arista-hardware-utilization-alert
# snmp-server enable traps external-alarm arista-external-alarm-asserted-notif arista-external-alarm-deasserted-notif
#
# Module Execution
#
# "after": {
# "communities": [
# {
# "acl_v6": "list1",
# "name": "comm3",
# "ro": true,
# "view": "view1"
# },
# {
# "acl_v4": "list3",
# "name": "comm4",
# "ro": true,
# "view": "view1"
# },
# {
# "acl_v4": "list4",
# "name": "comm5",
# "ro": true
# }
# ],
# "contact": "admin",
# "groups": [
# {
# "group": "group1",
# "read": "view1",
# "version": "v1"
# },
# {
# "auth_privacy": "priv",
# "group": "group2",
# "notify": "view1",
# "version": "v3",
# "write": "view2"
# }
# ],
# "hosts": [
# {
# "host": "host01",
# "udp_port": 23,
# "user": "user01",
# "version": "3 priv"
# },
# {
# "host": "host02",
# "udp_port": 23,
# "user": "user01",
# "version": "2c"
# }
# ],
# "traps": {
# "bgp": {
# "enabled": true
# },
# "capacity": {
# "arista_hardware_utilization_alert": true
# },
# "external_alarm": {
# "arista_external_alarm_asserted_notif": true,
# "arista_external_alarm_deasserted_notif": true
# }
# },
# "vrfs": [
# {
# "local_interface": "Ethernet1",
# "vrf": "vrf01"
# }
# ]
# },
# "before": {},
# "changed": true,
# "commands": [
# "snmp-server community comm3 view view1 ipv6 list1",
# "snmp-server community comm4 view view1 list3",
# "snmp-server community comm5 ro list4",
# "snmp-server group group1 v1 read view1",
# "snmp-server group group2 v3 priv write view2 notify view1",
# "snmp-server host host02 version 2c user01 udp-port 23",
# "snmp-server host host01 version 3 priv user01 udp-port 23",
# "snmp-server vrf vrf01 local-interface Ethernet1",
# "snmp-server contact admin",
# "snmp-server engineID remote 1.1.1.1 1234567",
# "snmp-server enable traps bgp",
# "snmp-server enable traps capacity arista-hardware-utilization-alert",
# "snmp-server enable traps external-alarm arista-external-alarm-asserted-notif arista-external-alarm-deasserted-notif"
# ],
#
# Using replaced:
# Before State:
# eos#show running-config | section snmp-server
# snmp-server community comm3 view view1 ipv6 list1
# snmp-server community comm4 view view1 list3
# snmp-server community comm5 ro list4
# snmp-server group group1 v1 read view1
# snmp-server group group2 v3 priv write view2 notify view1
# snmp-server host host02 version 2c user01 udp-port 23
# snmp-server host host01 version 3 priv user01 udp-port 23
# snmp-server vrf vrf01 local-interface Ethernet1
# snmp-server contact admin
# snmp-server enable traps bgp
# snmp-server enable traps capacity arista-hardware-utilization-alert
# snmp-server enable traps external-alarm arista-external-alarm-asserted-notif arista-external-alarm-deasserted-notif
- name: Replace given snmp_server configuration
become: true
register: result
arista.eos.eos_snmp_server: &replaced
state: replaced
config:
communities:
- name: "comm3"
acl_v6: "list1"
view: "view1"
- name: "replacecomm"
acl_v4: "list4"
extension:
root_oid: "123456"
script_location: "flash:"
traps:
test:
arista_test_notification: true
bgp:
enabled: true
vrfs:
- vrf: "vrf_replace"
local_interface: "Ethernet1"
# After State:
# eos#show running-config | section snmp-server
# snmp-server community comm3 view view1 ipv6 list1
# snmp-server community replacecomm list4
# snmp-server vrf vrf_replace local-interface Ethernet1
# snmp-server extension 123456 flash:
# snmp-server enable traps test arista-test-notification
# snmp-server enable traps bgp
# Module Execution:
# "after": {
# "communities": [
# {
# "acl_v6": "list1",
# "name": "comm3",
# "ro": true,
# "view": "view1"
# },
# {
# "acl_v4": "list4",
# "name": "replacecomm",
# "ro": true
# }
# ],
# "extension": {
# "root_oid": "0.123456",
# "script_location": "flash:"
# },
# "traps": {
# "bgp": {
# "enabled": true
# },
# "test": {
# "arista_test_notification": true
# }
# },
# "vrfs": [
# {
# "local_interface": "Ethernet1",
# "vrf": "vrf_replace"
# }
# ]
# },
# "before": {
# "communities": [
# {
# "acl_v6": "list1",
# "name": "comm3",
# "ro": true,
# "view": "view1"
# },
# {
# "acl_v4": "list3",
# "name": "comm4",
# "ro": true,
# "view": "view1"
# },
# {
# "acl_v4": "list4",
# "name": "comm5",
# "ro": true
# }
# ],
# "contact": "admin",
# "groups": [
# {
# "group": "group1",
# "read": "view1",
# "version": "v1"
# },
# {
# "auth_privacy": "priv",
# "group": "group2",
# "notify": "view1",
# "version": "v3",
# "write": "view2"
# }
# ],
# "hosts": [
# {
# "host": "host01",
# "udp_port": 23,
# "user": "user01",
# "version": "3 priv"
# },
# {
# "host": "host02",
# "udp_port": 23,
# "user": "user01",
# "version": "2c"
# }
# ],
# "traps": {
# "bgp": {
# "enabled": true
# },
# "capacity": {
# "arista_hardware_utilization_alert": true
# },
# "external_alarm": {
# "arista_external_alarm_asserted_notif": true,
# "arista_external_alarm_deasserted_notif": true
# }
# },
# "vrfs": [
# {
# "local_interface": "Ethernet1",
# "vrf": "vrf01"
# }
# ]
# },
# "changed": true,
# "commands": [
# "snmp-server community comm3 view view1 ipv6 list1",
# "snmp-server community replacecomm list4",
# "no snmp-server community comm4 view view1 ro list3",
# "no snmp-server community comm5 ro list4",
# "no snmp-server group group1 v1 read view1",
# "no snmp-server group group2 v3 priv write view2 notify view1",
# "no snmp-server host host01 version 3 priv user01 udp-port 23",
# "no snmp-server host host02 version 2c user01 udp-port 23",
# "snmp-server vrf vrf_replace local-interface Ethernet1",
# "no snmp-server vrf vrf01 local-interface Ethernet1",
# "snmp-server extension 123456 flash:",
# "default snmp-server enable traps capacity arista-hardware-utilization-alert",
# "default snmp-server enable traps external-alarm arista-external-alarm-asserted-notif arista-external-alarm-deasserted-notif",
# "snmp-server enable traps test arista-test-notification",
# "no snmp-server contact admin"
# ],
# Using overridden:
# Before State:
# eos#show running-config | section snmp-server
# snmp-server community comm3 view view1 ipv6 list1
# snmp-server community comm4 view view1 list3
# snmp-server community comm5 ro list4
# snmp-server group group1 v1 read view1
# snmp-server group group2 v3 priv write view2 notify view1
# snmp-server host host02 version 2c user01 udp-port 23
# snmp-server host host01 version 3 priv user01 udp-port 23
# snmp-server vrf vrf01 local-interface Ethernet1
# snmp-server contact admin
# snmp-server enable traps bgp
# snmp-server enable traps capacity arista-hardware-utilization-alert
# snmp-server enable traps external-alarm arista-external-alarm-asserted-notif arista-external-alarm-deasserted-notif
- name: Override given snmp_server configuration
arista.eos.eos_snmp_server:
state: overridden
config:
communities:
- name: "comm3"
acl_v6: "list1"
view: "view1"
- name: "replacecomm"
acl_v4: "list4"
extension:
root_oid: "123456"
script_location: "flash:"
traps:
test:
arista_test_notification: true
bgp:
enabled: true
vrfs:
- vrf: "vrf_replace"
local_interface: "Ethernet1"
# After State:
# eos#show running-config | section snmp-server
# snmp-server community comm3 view view1 ipv6 list1
# snmp-server community replacecomm list4
# snmp-server vrf vrf_replace local-interface Ethernet1
# snmp-server extension 123456 flash:
# snmp-server enable traps test arista-test-notification
# snmp-server enable traps bgp
# Module Execution:
# "after": {
# "communities": [
# {
# "acl_v6": "list1",
# "name": "comm3",
# "ro": true,
# "view": "view1"
# },
# {
# "acl_v4": "list4",
# "name": "replacecomm",
# "ro": true
# }
# ],
# "extension": {
# "root_oid": "0.123456",
# "script_location": "flash:"
# },
# "traps": {
# "bgp": {
# "enabled": true
# },
# "test": {
# "arista_test_notification": true
# }
# },
# "vrfs": [
# {
# "local_interface": "Ethernet1",
# "vrf": "vrf_replace"
# }
# ]
# },
# "before": {
# "communities": [
# {
# "acl_v6": "list1",
# "name": "comm3",
# "ro": true,
# "view": "view1"
# },
# {
# "acl_v4": "list3",
# "name": "comm4",
# "ro": true,
# "view": "view1"
# },
# {
# "acl_v4": "list4",
# "name": "comm5",
# "ro": true
# }
# ],
# "contact": "admin",
# "groups": [
# {
# "group": "group1",
# "read": "view1",
# "version": "v1"
# },
# {
# "auth_privacy": "priv",
# "group": "group2",
# "notify": "view1",
# "version": "v3",
# "write": "view2"
# }
# ],
# "hosts": [
# {
# "host": "host01",
# "udp_port": 23,
# "user": "user01",
# "version": "3 priv"
# },
# {
# "host": "host02",
# "udp_port": 23,
# "user": "user01",
# "version": "2c"
# }
# ],
# "traps": {
# "bgp": {
# "enabled": true
# },
# "capacity": {
# "arista_hardware_utilization_alert": true
# },
# "external_alarm": {
# "arista_external_alarm_asserted_notif": true,
# "arista_external_alarm_deasserted_notif": true
# }
# },
# "vrfs": [
# {
# "local_interface": "Ethernet1",
# "vrf": "vrf01"
# }
# ]
# },
# "changed": true,
# "commands": [
# "snmp-server community comm3 view view1 ipv6 list1",
# "snmp-server community replacecomm list4",
# "no snmp-server community comm4 view view1 ro list3",
# "no snmp-server community comm5 ro list4",
# "no snmp-server group group1 v1 read view1",
# "no snmp-server group group2 v3 priv write view2 notify view1",
# "no snmp-server host host01 version 3 priv user01 udp-port 23",
# "no snmp-server host host02 version 2c user01 udp-port 23",
# "snmp-server vrf vrf_replace local-interface Ethernet1",
# "no snmp-server vrf vrf01 local-interface Ethernet1",
# "snmp-server extension 123456 flash:",
# "default snmp-server enable traps capacity arista-hardware-utilization-alert",
# "default snmp-server enable traps external-alarm arista-external-alarm-asserted-notif arista-external-alarm-deasserted-notif",
# "snmp-server enable traps test arista-test-notification",
# "no snmp-server contact admin"
# ],
# Using deleted:
# Before State:
# eos#show running-config | section snmp-server
# snmp-server community comm3 view view1 ipv6 list1
# snmp-server community comm4 view view1 list3
# snmp-server community comm5 ro list4
# snmp-server group group1 v1 read view1
# snmp-server group group2 v3 priv write view2 notify view1
# snmp-server host host02 version 2c user01 udp-port 23
# snmp-server host host01 version 3 priv user01 udp-port 23
# snmp-server vrf vrf01 local-interface Ethernet1
# snmp-server contact admin
# snmp-server enable traps bgp
# snmp-server enable traps capacity arista-hardware-utilization-alert
# snmp-server enable traps external-alarm arista-external-alarm-asserted-notif arista-external-alarm-deasserted-notif
- name: Delete given snmp_server configuration
arista.eos.eos_snmp_server:
state: deleted
# After State:
# eos#show running-config | section snmp-server
#
# Module Execution:
# "after": {},
# "before": {
# "communities": [
# {
# "acl_v6": "list1",
# "name": "comm3",
# "ro": true,
# "view": "view1"
# },
# {
# "acl_v4": "list3",
# "name": "comm4",
# "ro": true,
# "view": "view1"
# },
# {
# "acl_v4": "list4",
# "name": "comm5",
# "ro": true
# }
# ],
# "contact": "admin",
# "groups": [
# {
# "group": "group1",
# "read": "view1",
# "version": "v1"
# },
# {
# "auth_privacy": "priv",
# "group": "group2",
# "notify": "view1",
# "version": "v3",
# "write": "view2"
# }
# ],
# "hosts": [
# {
# "host": "host01",
# "udp_port": 23,
# "user": "user01",
# "version": "3 priv"
# },
# {
# "host": "host02",
# "udp_port": 23,
# "user": "user01",
# "version": "2c"
# }
# ],
# "traps": {
# "bgp": {
# "enabled": true
# },
# "capacity": {
# "arista_hardware_utilization_alert": true
# },
# "external_alarm": {
# "arista_external_alarm_asserted_notif": true,
# "arista_external_alarm_deasserted_notif": true
# }
# },
# "vrfs": [
# {
# "local_interface": "Ethernet1",
# "vrf": "vrf01"
# }
# ]
# },
# "changed": true,
# "commands": [
# "no snmp-server community comm3 view view1 ro ipv6 list1",
# "no snmp-server community comm4 view view1 ro list3",
# "no snmp-server community comm5 ro list4",
# "no snmp-server group group1 v1 read view1",
# "no snmp-server group group2 v3 priv write view2 notify view1",
# "no snmp-server host host01 version 3 priv user01 udp-port 23",
# "no snmp-server host host02 version 2c user01 udp-port 23",
# "no snmp-server vrf vrf01 local-interface Ethernet1",
# "no snmp-server contact admin",
# "default snmp-server enable traps bgp",
# "default snmp-server enable traps capacity arista-hardware-utilization-alert",
# "default snmp-server enable traps external-alarm arista-external-alarm-asserted-notif arista-external-alarm-deasserted-notif"
# ],
#
# Using parsed:
# _parsed.cfg
# snmp-server contact admin
# snmp-server vrf vrf01 local-interface Ethernet1
# snmp-server community comm3 view view1 ro ipv6 list1
# snmp-server community comm4 view view1 ro list3
# snmp-server community comm5 ro list4
# snmp-server group group1 v1 read view1
# snmp-server group group2 v3 priv write view2 notify view1
# snmp-server host host01 version 3 priv user01 udp-port 23
# snmp-server host host02 version 2c user01 udp-port 23
# snmp-server enable traps bgp
# snmp-server enable traps capacity arista-hardware-utilization-alert
# snmp-server enable traps external-alarm arista-external-alarm-asserted-notif
# snmp-server enable traps external-alarm arista-external-alarm-deasserted-notif
- name: Provide the running configuration for parsing (config to be parsed)
arista.eos.eos_snmp_server:
running_config: "{{ lookup('file', '_parsed.cfg') }}"
state: parsed
# Module Execution:
# "parsed": {
# "communities": [
# {
# "acl_v6": "list1",
# "name": "comm3",
# "ro": true,
# "view": "view1"
# },
# {
# "acl_v4": "list3",
# "name": "comm4",
# "ro": true,
# "view": "view1"
# },
# {
# "acl_v4": "list4",
# "name": "comm5",
# "ro": true
# }
# ],
# "contact": "admin",
# "groups": [
# {
# "group": "group1",
# "read": "view1",
# "version": "v1"
# },
# {
# "auth_privacy": "priv",
# "group": "group2",
# "notify": "view1",
# "version": "v3",
# "write": "view2"
# }
# ],
# "hosts": [
# {
# "host": "host01",
# "udp_port": 23,
# "user": "user01",
# "version": "3 priv"
# },
# {
# "host": "host02",
# "udp_port": 23,
# "user": "user01",
# "version": "2c"
# }
# ],
# "traps": {
# "bgp": {
# "enabled": true
# },
# "capacity": {
# "arista_hardware_utilization_alert": true
# },
# "external_alarm": {
# "arista_external_alarm_asserted_notif": true,
# "arista_external_alarm_deasserted_notif": true
# }
# },
# "vrfs": [
# {
# "local_interface": "Ethernet1",
# "vrf": "vrf01"
# }
# ]
# }
# Using rendered:
- name: Render given snmp_server configuration
arista.eos.eos_snmp_server:
state: "rendered"
config:
communities:
- name: "comm3"
acl_v6: "list1"
view: "view1"
- name: "comm4"
acl_v4: "list3"
view: "view1"
- name: "comm5"
acl_v4: "list4"
ro: true
contact: "admin"
engineid:
remote:
host: 1.1.1.1
id: "1234567"
groups:
- group: "group1"
version: "v1"
read: "view1"
- group: "group2"
version: "v3"
auth_privacy: "priv"
notify: "view1"
write: "view2"
hosts:
- host: "host02"
user: "user01"
udp_port: 23
version: "2c"
- host: "host01"
user: "user01"
udp_port: 23
version: "3 priv"
traps:
capacity:
arista_hardware_utilization_alert: true
bgp:
enabled: true
external_alarm:
arista_external_alarm_deasserted_notif: true
arista_external_alarm_asserted_notif: true
vrfs:
- vrf: "vrf01"
local_interface: "Ethernet1"
# Module Execution:
# "rendered": [
# "snmp-server community comm3 view view1 ipv6 list1",
# "snmp-server community comm4 view view1 list3",
# "snmp-server community comm5 ro list4",
# "snmp-server group group1 v1 read view1",
# "snmp-server group group2 v3 priv write view2 notify view1",
# "snmp-server host host02 version 2c user01 udp-port 23",
# "snmp-server host host01 version 3 priv user01 udp-port 23",
# "snmp-server vrf vrf01 local-interface Ethernet1",
# "snmp-server contact admin",
# "snmp-server engineID remote 1.1.1.1 1234567",
# "snmp-server enable traps bgp",
# "snmp-server enable traps capacity arista-hardware-utilization-alert",
# "snmp-server enable traps external-alarm arista-external-alarm-asserted-notif arista-external-alarm-deasserted-notif"
# ]
# using gathered:
# eos#show running-config | section snmp-server
# snmp-server community comm3 view view1 ipv6 list1
# snmp-server community comm4 view view1 list3
# snmp-server community comm5 ro list4
# snmp-server group group1 v1 read view1
# snmp-server group group2 v3 priv write view2 notify view1
# snmp-server host host02 version 2c user01 udp-port 23
# snmp-server host host01 version 3 priv user01 udp-port 23
# snmp-server vrf vrf01 local-interface Ethernet1
# snmp-server contact admin
# snmp-server enable traps bgp
# snmp-server enable traps capacity arista-hardware-utilization-alert
# snmp-server enable traps external-alarm arista-external-alarm-asserted-notif arista-external-alarm-deasserted-notif
- name: Gathered the provided configuration with the exisiting running configuration
arista.eos.eos_snmp_server:
config:
state: gathered
# Module Execution:
# "gathered": {
# "communities": [
# {
# "acl_v6": "list1",
# "name": "comm3",
# "ro": true,
# "view": "view1"
# },
# {
# "acl_v4": "list3",
# "name": "comm4",
# "ro": true,
# "view": "view1"
# },
# {
# "acl_v4": "list4",
# "name": "comm5",
# "ro": true
# }
# ],
# "contact": "admin",
# "groups": [
# {
# "group": "group1",
# "read": "view1",
# "version": "v1"
# },
# {
# "auth_privacy": "priv",
# "group": "group2",
# "notify": "view1",
# "version": "v3",
# "write": "view2"
# }
# ],
# "hosts": [
# {
# "host": "host01",
# "udp_port": 23,
# "user": "user01",
# "version": "3 priv"
# },
# {
# "host": "host02",
# "udp_port": 23,
# "user": "user01",
# "version": "2c"
# }
# ],
# "traps": {
# "bgp": {
# "enabled": true
# },
# "capacity": {
# "arista_hardware_utilization_alert": true
# },
# "external_alarm": {
# "arista_external_alarm_asserted_notif": true,
# "arista_external_alarm_deasserted_notif": true
# }
# },
# "vrfs": [
# {
# "local_interface": "Ethernet1",
# "vrf": "vrf01"
# }
# ]
# },
返回值
常见的返回值已在此处记录,以下是此模块特有的字段
键 |
描述 |
---|---|
模块执行后的最终配置。 返回:发生更改时 示例: |
|
模块执行之前的配置。 返回:当 *state* 为 示例: |
|
推送到远程设备的命令集。 返回:当 *state* 为 示例: |
|
从远程设备收集的网络资源事实,作为结构化数据。 返回:当 *state* 为 示例: |
|
根据模块 argspec 将 *running_config* 选项中提供的设备原生配置解析为结构化数据。 返回:当 *state* 为 示例: |
|
以设备原生格式呈现的任务中提供的配置(脱机)。 返回:当 *state* 为 示例: |