cisco.ios.ios_snmp_server 模块 – 配置 SNMP 服务器的资源模块。
注意
此模块是 cisco.ios 集合 (版本 9.0.3) 的一部分。
如果您使用的是 ansible
包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install cisco.ios
。
要在 playbook 中使用它,请指定: cisco.ios.ios_snmp_server
。
cisco.ios 2.6.0 中的新增功能
概要
此模块提供对 Cisco IOS 设备上 SNMP 服务器的声明式管理。
参数
参数 |
注释 |
---|---|
SNMP 服务器配置字典 |
|
SNMP 审计参数 |
|
用于 SNMP 设置命令 |
|
启用 SNMP 缓存和 MIB 到期间隔 |
|
唯一标识此底盘的字符串(十六进制) |
|
社区名称配置。 |
|
标准访问列表名称 |
|
IPv6 访问列表名称 |
|
社区名称(默认 RO) |
|
仅允许读取 选项
|
|
读写访问 选项
|
|
MIB 视图名称 |
|
mib 对象 sysContact 的文本 |
|
创建/删除除默认上下文之外的上下文 |
|
静默丢弃 SNMP 数据包 |
|
静默丢弃未知 v3 用户数据包 选项
|
|
静默丢弃在 VRF 接口上收到的 SNMP 数据包 选项
|
|
配置本地或远程 SNMPv3 engineID |
|
engine ID 八位字节串 |
|
本地 SNMP 代理 选项
|
|
远程 SNMP 代理 |
|
远程 SNMP 通知主机的名称或 IP 地址 |
|
远程 SNMP 通知主机的 UDP 端口号。 |
|
远程通知主机的 VPN 路由实例 |
|
文件传输相关命令 |
|
文件传输的访问控制 |
|
文件传输的访问控制协议 |
|
定义用户安全模型组 |
|
指定与此组关联的访问列表 |
|
指定与此组关联的访问列表 |
|
指定要与组关联的上下文 |
|
用户的 SNMP 组 |
|
指定上下文名称匹配条件 选项
|
|
限制通知的视图 |
|
限制读取访问的视图 |
|
snmp 安全组版本 选项
|
|
主机社区名称。 选项
|
|
限制写入访问的视图 |
|
指定接收 SNMP 通知的主机 |
|
SNMPv1/v2c 社区字符串或 SNMPv3 用户名 |
|
SNMP 通知主机的名称或 IP 地址。 |
|
使用 SNMP inform 消息。 选项
|
|
使用 SNMP trap 消息 |
|
通知消息 SNMP 版本。 选项
|
|
主机社区名称。 选项
|
|
指定配置主机的 VRF |
|
启用 ifindex 持久性 选项
|
|
配置 SNMP Informs 选项 |
|
设置要保留的未确认 inform 数量 |
|
设置 inform 的重试次数 |
|
设置 inform 的超时时间 |
|
SNMP 流量的 IP ToS 配置 |
|
SNMP 流量的 IP DSCP 值 |
|
SNMP 流量的 IP 优先级值 |
|
mib 对象 sysLocation 的文本 |
|
修改 SNMP 管理器参数 |
|
最大的 SNMP 数据包大小 |
|
SNMP v3 用户密码策略 |
|
旧密码和新密码之间的字符更改次数 |
|
数字个数 |
|
小写字符个数 |
|
最大密码长度 |
|
最小密码长度 |
|
策略名称 |
|
特殊字符个数 |
|
大写字符个数 |
|
用户名 |
|
每个 TRAP 主机的消息队列长度 |
|
用于发送 SNMP 通知的消息源接口。 |
|
启用使用 SNMP reload 命令 选项
|
|
分配所有陷阱的源地址接口 |
|
设置TRAP消息重传超时时间 |
|
启用SNMP陷阱 |
|
启用SNMP AAA服务器陷阱 选项
|
|
启用SNMP CISCO-AUTH-FRAMEWORK-MIB陷阱 |
|
启用/禁用身份验证框架 选项
|
|
安全违规模式 选项
|
|
允许SNMP BFD陷阱 |
|
启用/禁用bfd 选项
|
|
启用BFD会话断开陷阱 选项
|
|
启用BFD会话建立陷阱 选项
|
|
允许BGP陷阱 |
|
启用BGP MIBv2陷阱 选项
|
|
启用/禁用BGP陷阱 选项
|
|
FSM状态变化陷阱 |
|
所有FSM状态变化的CISCO专用陷阱 选项
|
|
反向转换的CISCO专用陷阱 选项
|
|
启用/禁用BGP state_changes陷阱 选项
|
|
标准反向转换和已建立的陷阱 选项
|
|
阈值模式 |
|
启用/禁用BGP阈值陷阱 选项
|
|
允许桥接相关的陷阱 |
|
启用/禁用桥接陷阱 选项
|
|
启用SNMP STP Bridge MIB newroot陷阱 选项
|
|
启用SNMP STP Bridge MIB topologychange陷阱 选项
|
|
允许Data-Collection-MIB收集通知 |
|
启用Data-Collection-MIB收集通知 选项
|
|
启用Data-Collection-MIB收集和传输通知 选项
|
|
启用Data-Collection-MIB传输通知 选项
|
|
SNMP CISCO-CALLHOME-MIB陷阱 |
|
启用SNMP CISCO-CALLHOME-MIB陷阱 选项
|
|
启用SNMP ccmSmtpMsgSendFailNotif通知 选项
|
|
启用SNMP ccmSmtpServerFailNotif通知 选项
|
|
启用SNMP配置casa陷阱 选项
|
|
允许cef相关的陷阱 |
|
启用/禁用cef陷阱 选项
|
|
启用SNMP CEF不一致陷阱 选项
|
|
启用SNMP CEF对端FIB状态变化陷阱 选项
|
|
启用SNMP CEF对端状态变化陷阱 选项
|
|
启用SNMP CEF资源故障陷阱 选项
|
|
启用SNMP cnpd陷阱 选项
|
|
启用SNMP配置陷阱 选项
|
|
启用SNMP配置复制陷阱 选项
|
|
启用SNMP配置ctid陷阱 选项
|
|
允许CPU相关的陷阱 |
|
启用/禁用CPU陷阱 选项
|
|
阈值模式 选项
|
|
启用SNMP DHCP陷阱 选项
|
|
允许dlsw相关的陷阱 |
|
启用SNMP dlsw电路陷阱 选项
|
|
启用/禁用cef陷阱 选项
|
|
启用SNMP dlsw对端传输连接陷阱 选项
|
|
启用SNMP EIGRP陷阱 选项
|
|
启用SNMP EnergyWise陷阱 选项
|
|
启用SNMP实体陷阱 选项
|
|
允许SNMP CISCO-ENTITY-DIAG-MIB陷阱 |
|
启用SNMP ceDiagBootUpFailedNotif陷阱 选项
|
|
启用SNMP CISCO-ENTITY-DIAG-MIB陷阱 选项
|
|
启用SNMP ceDiagHMTestRecoverNotif陷阱 选项
|
|
启用SNMP ceDiagHMThresholdReachedNotif陷阱 选项
|
|
启用SNMP ceDiagScheduledTestFailedNotif陷阱 选项
|
|
允许SNMP CISCO-ENTITY-PERFORMANCE-MIB陷阱 |
|
启用SNMP CISCO-ENTITY-PERFORMANCE-MIB陷阱 选项
|
|
启用ENTITY PERFORMANCE MIB吞吐量陷阱 选项
|
|
启用SNMP ENTITY-STATE-MIB陷阱 选项
|
|
启用SNMP环境监控陷阱 |
|
启用/禁用envmon陷阱 选项
|
|
启用SNMP envmon风扇陷阱 此选项已弃用,并被接受bool作为输入的fan_enable替换 此属性将在2024-09-01之后删除 |
|
启用/禁用风扇陷阱 选项
|
|
启用SNMP环境监控关机陷阱 选项
|
|
启用SNMP环境状态变化陷阱 选项
|
|
启用SNMP环境监控电源陷阱 选项
|
|
启用SNMP环境监控温度陷阱 选项
|
|
启用SNMP envmon风扇陷阱 选项
|
|
启用SNMP环境监控关机陷阱 选项
|
|
启用SNMP环境状态变化陷阱 选项
|
|
启用SNMP环境监控电源陷阱 选项
|
|
启用SNMP环境监控温度陷阱 选项
|
|
启用SNMP errdisable通知 选项
|
|
启用SNMP以太网OAM陷阱 选项
|
|
允许以太网陷阱 |
|
启用SNMP以太网CFM陷阱 |
|
启用SNMP以太网CFM故障告警陷阱 选项
|
|
启用SNMP以太网CC陷阱 |
|
启用SNMP以太网CFM配置错误陷阱 选项
|
|
启用SNMP以太网CFM交叉连接陷阱 选项
|
|
启用SNMP以太网CFM环路陷阱 选项
|
|
启用SNMP以太网CFM CC下行陷阱 选项
|
|
启用SNMP以太网CFM CC上行陷阱 选项
|
|
启用SNMP以太网CC交叉检查陷阱 |
|
启用SNMP以太网CC交叉检查丢失陷阱 选项
|
|
启用SNMP以太网CC交叉检查未知陷阱 选项
|
|
启用SNMP以太网CC交叉检查服务陷阱 选项
|
|
启用SNMP以太网EVC陷阱 |
|
启用SNMP以太网EVC创建陷阱 选项
|
|
启用SNMP以太网EVC删除陷阱 选项
|
|
启用SNMP以太网EVC状态陷阱 选项
|
|
启用SNMP事件管理器陷阱 选项
|
|
启用SNMP防火墙陷阱 |
|
启用/禁用防火墙陷阱 选项
|
|
启用防火墙服务器状态变化陷阱 选项
|
|
SNMP FLASH通知 |
|
启用SNMP FLASH通知 选项
|
|
启用SNMP Flash插入通知 选项
|
|
启用SNMP Flash空间不足通知 选项
|
|
启用SNMP Flash移除通知 选项
|
|
SNMP FLEX Links陷阱 |
|
启用SNMP FLEX Links陷阱 选项
|
|
启用SNMP FLEX Links状态变化陷阱 选项
|
|
启用SNMP Flowmon陷阱 选项
|
|
允许帧中继陷阱 |
|
启用/禁用帧中继陷阱 选项
|
|
启用SNMP帧中继子接口陷阱 |
|
每个间隔发送的陷阱最大数量 |
|
启用/禁用子接口陷阱 选项
|
|
限制发送陷阱数量的间隔持续时间 |
|
启用SNMP fru-ctrl陷阱 选项
|
|
启用SNMP HSRP陷阱 选项
|
|
允许IKE陷阱 |
|
启用IKE策略陷阱 |
|
启用IKE策略添加陷阱 选项
|
|
启用IKE策略删除陷阱 选项
|
|
启用IKE隧道陷阱 |
|
启用IKE隧道启动陷阱 选项
|
|
启用IKE隧道停止陷阱 选项
|
|
启用SNMP IP组播陷阱 选项
|
|
允许IKE陷阱 |
|
启用IPSec Cryptomap陷阱 |
|
启用IPSec Cryptomap添加陷阱 选项
|
|
启用IPSec Cryptomap关联陷阱 选项
|
|
启用IPSec Cryptomap删除陷阱 选项
|
|
启用IPSec Cryptomap解除关联陷阱 选项
|
|
启用IPSec隧道启动陷阱 选项
|
|
启用IPSec隧道陷阱 |
|
启用IPSec隧道启动陷阱 选项
|
|
启用IPSec隧道停止陷阱 选项
|
|
启用SNMP IPSLA陷阱 选项
|
|
启用SNMP ISIS陷阱 选项
|
|
允许SNMP L2隧道配置陷阱 |
|
启用SNMP L2隧道配置陷阱 选项
|
|
启用SNMP L2TC系统阈值陷阱 选项
|
|
启用SNMP L2隧道配置阈值陷阱 选项
|
|
允许SNMP l2tun陷阱 |
|
启用BFD伪线状态陷阱 选项
|
|
启用BFD会话陷阱 选项
|
|
启用许可证陷阱 选项
|
|
启用SNMP LISP MIB陷阱 选项
|
|
启用SNMP本地认证陷阱 选项
|
|
允许SNMP MAC通知陷阱 |
|
启用SNMP MAC更改陷阱 选项
|
|
启用SNMP MAC通知陷阱 选项
|
|
启用SNMP MAC移动陷阱 选项
|
|
启用SNMP MAC阈值陷阱 选项
|
|
允许内存陷阱 |
|
启用SNMP内存缓冲区峰值陷阱 选项
|
|
启用内存陷阱 选项
|
|
启用SNMP MPLS陷阱 |
|
允许SNMP MPLS快速重路由陷阱 |
|
启用SNMP MPLS快速重路由陷阱 选项
|
|
启用MPLS快速重路由保护陷阱 选项
|
|
允许SNMP MPLS标签分发协议陷阱 |
|
启用SNMP MPLS标签分发协议陷阱 选项
|
|
启用MPLS LDP路径向量限制不匹配陷阱 选项
|
|
启用MPLS LDP会话断开陷阱 选项
|
|
启用MPLS LDP会话建立陷阱 选项
|
|
启用MPLS LDP阈值超过陷阱 选项
|
|
启用SNMP MPLS RFC陷阱 |
|
允许SNMP MPLS标签分发协议RFC陷阱 |
|
启用SNMP MPLS标签分发协议RFC陷阱 选项
|
|
启用MPLS LDP路径向量限制不匹配RFC陷阱 选项
|
|
启用MPLS LDP会话断开RFC陷阱 选项
|
|
启用MPLS LDP会话建立RFC陷阱 选项
|
|
启用MPLS LDP阈值超过RFC陷阱 选项
|
|
允许SNMP MPLS流量工程RFC陷阱 |
|
启用MPLS TE隧道下行RFC陷阱 选项
|
|
启用SNMP MPLS流量工程RFC陷阱 选项
|
|
启用MPLS TE隧道重新优化RFC陷阱 选项
|
|
启用MPLS TE隧道重路由RFC陷阱 选项
|
|
启用MPLS TE隧道上行RFC陷阱 选项
|
|
允许SNMP MPLS虚拟专用网络RFC陷阱 |
|
启用SNMP MPLS虚拟专用网络RFC陷阱 选项
|
|
启用MPLS VPN非法标签阈值超过RFC陷阱 选项
|
|
启用MPLS VPN最大阈值清除RFC陷阱 选项
|
|
启用MPLS VPN最大阈值超过RFC陷阱 选项
|
|
启用MPLS VPN中间阈值超过RFC陷阱 选项
|
|
启用MPLS VPN VRF下行RFC陷阱 选项
|
|
启用MPLS VPN VRF上行RFC陷阱 选项
|
|
允许SNMP MPLS流量工程陷阱 |
|
启用MPLS TE隧道下行陷阱 选项
|
|
启用SNMP MPLS流量工程陷阱 选项
|
|
启用MPLS TE隧道重路由陷阱 选项
|
|
启用MPLS TE隧道上行陷阱 选项
|
|
允许SNMP MPLS虚拟专用网络陷阱 |
|
启用SNMP MPLS虚拟专用网络陷阱 选项
|
|
启用MPLS VPN非法标签阈值超过陷阱 选项
|
|
启用MPLS VPN最大阈值清除陷阱 选项
|
|
启用MPLS VPN最大阈值超过陷阱 选项
|
|
启用MPLS VPN中间阈值超过陷阱 选项
|
|
启用MPLS VPN VRF下行陷阱 选项
|
|
启用MPLS VPN VRF上行陷阱 选项
|
|
启用SNMP MPLS陷阱 此选项已弃用,并被接受dict作为输入的mpls替换 此属性将在2024-09-01之后删除 选项
|
|
启用SNMP MSDP陷阱 选项
|
|
启用SNMP MVPN陷阱 选项
|
|
允许SNMP NHRP陷阱 |
|
启用SNMP NHRP陷阱 选项
|
|
允许下一跳客户端陷阱 |
|
启用下一跳客户端故障陷阱 选项
|
|
启用下一跳客户端陷阱 选项
|
|
启用下一跳客户端恢复陷阱 选项
|
|
允许下一跳对端陷阱 |
|
启用下一跳对端故障陷阱 选项
|
|
启用下一跳对端陷阱 选项
|
|
启用下一跳对端恢复陷阱 选项
|
|
允许下一跳服务器陷阱 |
|
启用下一跳服务器故障陷阱 选项
|
|
启用下一跳服务器陷阱 选项
|
|
启用下一跳服务器恢复陷阱 选项
|
|
启用配额超出陷阱 选项
|
|
允许与OSPF相关的陷阱 |
|
思科特定陷阱 |
|
错误陷阱 选项
|
|
与LSA相关的陷阱 选项
|
|
数据包重传陷阱 选项
|
|
状态更改陷阱 |
|
NSSA转换器状态更改 选项
|
|
虚拟接口上的配置不匹配错误 |
|
Sham链路接口状态更改 选项
|
|
Sham链路邻居状态更改 选项
|
|
启用错误陷阱 选项
|
|
启用/禁用OSPF LSA陷阱 选项
|
|
启用/禁用OSPF重传陷阱 选项
|
|
启用/禁用状态更改陷阱 选项
|
|
允许与OSPFv3相关的陷阱 |
|
错误陷阱 |
|
非虚拟接口上的数据包解析失败 选项
|
|
非虚拟接口上的配置不匹配错误 选项
|
|
启用错误陷阱 选项
|
|
虚拟接口上的数据包解析失败 选项
|
|
虚拟接口上的配置不匹配错误 选项
|
|
陷阱速率限制值 速率限制窗口大小(秒)(2到60之间) |
|
状态更改陷阱 |
|
启用状态更改陷阱 选项
|
|
非虚拟接口状态更改 选项
|
|
邻居优雅重启助手状态更改 选项
|
|
非虚拟邻居状态更改 选项
|
|
NSSA转换器状态更改 选项
|
|
优雅重启状态更改 选项
|
|
虚拟接口状态更改 选项
|
|
虚拟邻居优雅重启助手状态更改 选项
|
|
虚拟邻居状态更改 选项
|
|
允许PIM陷阱 |
|
启用/禁用PIM陷阱 选项
|
|
启用无效PIM消息陷阱 选项
|
|
启用邻居更改陷阱 选项
|
|
启用RP映射更改陷阱 选项
|
|
启用SNMP PKI陷阱 选项
|
|
启用SNMP端口安全陷阱 选项
|
|
允许SNMP以太网供电陷阱 |
|
启用SNMP以太网供电陷阱 选项
|
|
启用基于SNMP内联电源组的陷阱。 |
|
1到20之间的整数(物理槽位号) |
|
此槽位的阈值级别 |
|
启用策略监管陷阱 选项
|
|
启用SNMP PW VC陷阱 选项
|
|
启用SNMP弹性以太网协议陷阱 选项
|
|
启用CISCO-RF-MIB中定义的所有SNMP陷阱 选项
|
|
启用SNMP RSVP陷阱 选项
|
|
允许智能许可证陷阱 |
|
启用智能许可证陷阱 选项
|
|
启用授权通知陷阱 选项
|
|
启用全局通知陷阱 选项
|
|
启用SNMP陷阱 |
|
启用身份验证陷阱 选项
|
|
启用coldStart陷阱 选项
|
|
启用linkDown陷阱 选项
|
|
启用linkUp陷阱 选项
|
|
启用warmStart陷阱 选项
|
|
启用SNMP StackWise陷阱 选项
|
|
允许SNMP STPX MIB陷阱 |
|
启用SNMP STPX MIB陷阱 选项
|
|
启用SNMP STPX MIB不一致更新陷阱 选项
|
|
启用SNMP STPX MIB环路不一致更新陷阱 选项
|
|
启用SNMP STPX MIB根不一致更新陷阱 选项
|
|
启用SNMP syslog陷阱 选项
|
|
启用SNMP收发器陷阱 选项
|
|
允许SNMP CISCO-TRUSTSEC-MIB陷阱 |
|
启用ctsAuthzCacheFileErrNotif通知 选项
|
|
启用ctsCacheFileAccessErrNotif通知 选项
|
|
启用SNMP CISCO-TRUSTSEC-MIB陷阱 选项
|
|
启用ctsSwKeystoreFileErrNotif通知 选项
|
|
启用ctsSwKeystoreSyncFailNotif通知 选项
|
|
启用ctsSapRandonNumberFailNotif通知 选项
|
|
启用ctsSrcEntropyFailNotif通知 选项
|
|
允许SNMP CISCO-TRUSTSEC-INTERFACE-MIB陷阱 |
|
启用ctsiIfAuthenticationFailNotif陷阱 选项
|
|
启用ctsiAuthorizationFailNotif陷阱 选项
|
|
启用SNMP CISCO-TRUSTSEC-INTERFACE-MIB陷阱 选项
|
|
启用ctsiIfSapNegotiationFailNotif陷阱 选项
|
|
启用ctsiIfAddSupplicantFailNotif陷阱 选项
|
|
启用ctsiIfUnauthorizedNotifEnable陷阱 选项
|
|
允许SNMP CISCO-TRUSTSEC-POLICY-MIB陷阱 |
|
启用ctspAuthorizationSgaclFailNotif通知 选项
|
|
启用SNMP CISCO-TRUSTSEC-POLICY-MIB陷阱 选项
|
|
启用ctspPeerPolicyUpdatedNotif通知 选项
|
|
允许SNMP CISCO-TRUSTSEC-SERVER-MIB陷阱 |
|
启用SNMP CISCO-TRUSTSEC-SERVER-MIB陷阱 选项
|
|
启用ctsvNoProvisionSecretNotif通知 选项
|
|
启用ctsvNoRadiusServerNotif通知 选项
|
|
允许SNMP CISCO-TRUSTSEC-SXP-MIB陷阱 |
|
启用ctsxSxpBindingConflictNotif通知 选项
|
|
启用ctsxSxpBindingErrNotif通知 选项
|
|
启用ctsxSxpBindingExpnFailNotif通知 选项
|
|
启用ctsxSxpConnConfigErrNotif通知 选项
|
|
启用ctsxSxpConnDownNotif通知 选项
|
|
启用ctsxSxpConnSourceAddrErrNotif通知 选项
|
|
启用ctsxSxpConnUpNotif通知 选项
|
|
启用SNMP CISCO-TRUSTSEC-SXP-MIB陷阱 选项
|
|
启用ctsxSxpMsgParseErrNotif通知 选项
|
|
启用ctsxSxpOperNodeIdChangeNotif通知 选项
|
|
启用SNMP tty TCP连接陷阱 选项
|
|
允许SNMP CISCO-UDLDP-MIB陷阱 |
|
启用SNMP CISCO-UDLDP-MIB陷阱 选项
|
|
启用SNMP cudldpFastHelloLinkFailRptNotification陷阱 选项
|
|
启用SNMP cudldpFastHelloStatusChangeNotification陷阱 选项
|
|
启用SNMP VLAN成员资格陷阱 选项
|
|
启用SNMP VLAN创建陷阱 选项
|
|
启用SNMP VLAN删除陷阱 选项
|
|
允许vrfmib陷阱 |
|
启用vnet-trunk-down陷阱 选项
|
|
启用vnet-trunk-up陷阱 选项
|
|
启用vrf-down陷阱 选项
|
|
启用vrf-up陷阱 选项
|
|
启用SNMP VRRP陷阱 选项
|
|
允许SNMP虚拟交换机通知 |
|
启用SNMP虚拟交换机(双活动)通知 选项
|
|
启用SNMP虚拟交换机通知 选项
|
|
启用SNMP虚拟交换机链路(VSL)通知 选项
|
|
启用SNMP VTP陷阱 选项
|
|
定义可以访问SNMP引擎的用户 |
|
关联的IPv4访问列表 |
|
关联的IPv6访问列表 |
|
用户的身份验证参数。 模块的幂等性效果,因为应用的配置未反映在运行配置中。 |
|
选择身份验证算法。 选项
|
|
用户的身份验证密码。 |
|
用户的加密参数。 模块的幂等性效果,因为应用的配置未反映在运行配置中。 |
|
用户的身份验证密码。 |
|
选择加密算法。 选项
|
|
如有任何特定私有选项,请添加额外选项。 |
|
用户的SNMP组。 |
|
托管SNMPv3用户的系统 |
|
远程SNMP系统使用的UDP端口 |
|
SNMP用户名 |
|
SNMP安全版本 选项
|
|
启用加密版本选项。 选项
|
|
远程SNMP实体的VPN路由实例 |
|
定义SNMPv2 MIB视图 |
|
MIB族被从视图中排除 选项
|
|
MIB视图族名称 |
|
MIB族包含在视图中 选项
|
|
视图名称 |
|
此选项仅与状态*parsed*一起使用。 此选项的值应为通过执行命令**show running-config | include snmp-server**从IOS设备接收到的输出。 状态*parsed*从 |
|
配置应保留的状态。 有关更多详细信息,请参阅示例。 对于此模块,状态*replaced*和*overridden*的行为相同。 选项
|
注释
注意
在CML上的Cisco IOS XE版本17.3上进行了测试。
此模块适用于连接
network_cli
。
示例
# Using state: merged
# Before state:
# -------------
# router-ios#show running-config | section ^snmp-server
# --------------------- EMPTY -----------------
# Merged play:
# ------------
- name: Apply the provided configuration
cisco.ios.ios_snmp_server:
config:
communities:
- acl_v4: testACL
name: mergedComm
rw: true
contact: contact updated using merged
engine_id:
- id: AB0C5342FF0F
remote:
host: 172.16.0.12
udp_port: 25
groups:
- group: mergedGroup
version: v3
version_option: auth
file_transfer:
access_group: test
protocol:
- ftp
hosts:
- community_string: mergedComm
host: 172.16.2.9
informs: true
traps:
- msdp
- stun
- pki
version: 2c
- community_string: mergedComm
host: 172.16.2.9
traps:
- slb
- pki
password_policy:
- change: 3
digits: 23
lower_case: 12
max_len: 24
policy_name: MergedPolicy
special_char: 32
upper_case: 12
- change: 43
min_len: 12
policy_name: MergedPolicy2
special_char: 22
upper_case: 12
- change: 11
digits: 23
max_len: 12
min_len: 12
policy_name: policy3
special_char: 22
upper_case: 12
traps:
cef:
enable: true
inconsistency: true
peer_fib_state_change: true
peer_state_change: true
resource_failure: true
msdp: true
ospf:
cisco_specific:
error: true
lsa: true
retransmit: true
state_change:
nssa_trans_change: true
shamlink:
interface: true
neighbor: true
error: true
lsa: true
retransmit: true
state_change: true
syslog: true
tty: true
users:
- acl_v4: "24"
group: dev
username: userPaul
version: v1
state: merged
# Commands Fired:
# ---------------
# "commands": [
# "snmp-server contact contact updated using merged",
# "snmp-server file-transfer access-group test protocol ftp",
# "snmp-server enable traps msdp",
# "snmp-server enable traps syslog",
# "snmp-server enable traps tty",
# "snmp-server enable traps ospf cisco-specific errors",
# "snmp-server enable traps ospf cisco-specific retransmit",
# "snmp-server enable traps ospf cisco-specific lsa",
# "snmp-server enable traps ospf cisco-specific state-change nssa-trans-change",
# "snmp-server enable traps ospf cisco-specific state-change shamlink interface",
# "snmp-server enable traps ospf cisco-specific state-change shamlink neighbor",
# "snmp-server enable traps ospf errors",
# "snmp-server enable traps ospf retransmit",
# "snmp-server enable traps ospf lsa",
# "snmp-server enable traps ospf state-change",
# "snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency",
# "snmp-server host 172.16.2.9 informs version 2c mergedComm msdp stun pki",
# "snmp-server host 172.16.2.9 mergedComm slb pki",
# "snmp-server group mergedGroup v3 auth",
# "snmp-server engineID remote 172.16.0.12 udp-port 25 AB0C5342FF0F",
# "snmp-server community mergedComm rw testACL",
# "snmp-server password-policy MergedPolicy define max-len 24 upper-case 12 lower-case 12 special-char 32 digits 23 change 3",
# "snmp-server password-policy MergedPolicy2 define min-len 12 upper-case 12 special-char 22 change 43",
# "snmp-server password-policy policy3 define min-len 12 max-len 12 upper-case 12 special-char 22 digits 23 change 11",
# "snmp-server user userPaul dev v1 access 24"
# ],
# After state:
# ------------
# router-ios#show running-config | section ^snmp-server
# snmp-server engineID remote 172.16.0.12 udp-port 25 AB0C5342FF0F
# snmp-server user userPaul dev v1 access 24
# snmp-server group mergedGroup v3 auth
# snmp-server community mergedComm RW testACL
# snmp-server contact contact updated using merged
# snmp-server enable traps tty
# snmp-server enable traps ospf state-change
# snmp-server enable traps ospf errors
# snmp-server enable traps ospf retransmit
# snmp-server enable traps ospf lsa
# snmp-server enable traps ospf cisco-specific state-change nssa-trans-change
# snmp-server enable traps ospf cisco-specific state-change shamlink interface
# snmp-server enable traps ospf cisco-specific state-change shamlink neighbor
# snmp-server enable traps ospf cisco-specific errors
# snmp-server enable traps ospf cisco-specific retransmit
# snmp-server enable traps ospf cisco-specific lsa
# snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency
# snmp-server enable traps msdp
# snmp-server enable traps syslog
# snmp-server host 172.16.2.9 informs version 2c mergedComm msdp stun pki
# snmp-server host 172.16.2.9 mergedComm slb pki
# snmp-server file-transfer access-group test protocol ftp
# snmp-server password-policy MergedPolicy define max-len 24 upper-case 12 lower-case 12 special-char 32 digits 23 change 3
# snmp-server password-policy MergedPolicy2 define min-len 12 upper-case 12 special-char 22 change 43
# snmp-server password-policy policy3 define min-len 12 max-len 12 upper-case 12 special-char 22 digits 23 change 11
# Using state: deleted
# Before state:
# -------------
# router-ios#show running-config | section ^snmp-server
# snmp-server engineID remote 172.16.0.12 udp-port 25 AB0C5342FF0F
# snmp-server user userPaul dev v1 access 24
# snmp-server group mergedGroup v3 auth
# snmp-server community mergedComm RW testACL
# snmp-server contact contact updated using merged
# snmp-server enable traps tty
# snmp-server enable traps ospf state-change
# snmp-server enable traps ospf errors
# snmp-server enable traps ospf retransmit
# snmp-server enable traps ospf lsa
# snmp-server enable traps ospf cisco-specific state-change nssa-trans-change
# snmp-server enable traps ospf cisco-specific state-change shamlink interface
# snmp-server enable traps ospf cisco-specific state-change shamlink neighbor
# snmp-server enable traps ospf cisco-specific errors
# snmp-server enable traps ospf cisco-specific retransmit
# snmp-server enable traps ospf cisco-specific lsa
# snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency
# snmp-server enable traps msdp
# snmp-server enable traps syslog
# snmp-server host 172.16.2.9 informs version 2c mergedComm msdp stun pki
# snmp-server host 172.16.2.9 mergedComm slb pki
# snmp-server file-transfer access-group test protocol ftp
# snmp-server password-policy MergedPolicy define max-len 24 upper-case 12 lower-case 12 special-char 32 digits 23 change 3
# snmp-server password-policy MergedPolicy2 define min-len 12 upper-case 12 special-char 22 change 43
# snmp-server password-policy policy3 define min-len 12 max-len 12 upper-case 12 special-char 22 digits 23 change 11
# Deleted play:
# -------------
- name: Remove all existing configuration
cisco.ios.ios_snmp_server:
state: deleted
# Commands Fired:
# ---------------
# "commands": [
# "no snmp-server contact contact updated using merged",
# "no snmp-server file-transfer access-group test protocol ftp",
# "no snmp-server enable traps msdp",
# "no snmp-server enable traps syslog",
# "no snmp-server enable traps tty",
# "no snmp-server enable traps ospf cisco-specific errors",
# "no snmp-server enable traps ospf cisco-specific retransmit",
# "no snmp-server enable traps ospf cisco-specific lsa",
# "no snmp-server enable traps ospf cisco-specific state-change nssa-trans-change",
# "no snmp-server enable traps ospf cisco-specific state-change shamlink interface",
# "no snmp-server enable traps ospf cisco-specific state-change shamlink neighbor",
# "no snmp-server enable traps ospf errors",
# "no snmp-server enable traps ospf retransmit",
# "no snmp-server enable traps ospf lsa",
# "no snmp-server enable traps ospf state-change",
# "no snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency",
# "no snmp-server host 172.16.2.9 informs version 2c mergedComm msdp stun pki",
# "no snmp-server host 172.16.2.9 mergedComm slb pki",
# "no snmp-server group mergedGroup v3 auth",
# "no snmp-server engineID remote 172.16.0.12 udp-port 25 AB0C5342FF0F",
# "no snmp-server community mergedComm rw testACL",
# "no snmp-server password-policy MergedPolicy define max-len 24 upper-case 12 lower-case 12 special-char 32 digits 23 change 3",
# "no snmp-server password-policy MergedPolicy2 define min-len 12 upper-case 12 special-char 22 change 43",
# "no snmp-server password-policy policy3 define min-len 12 max-len 12 upper-case 12 special-char 22 digits 23 change 11",
# "no snmp-server user userPaul dev v1 access 24"
# ],
# After state:
# ------------
# router-ios#show running-config | section ^snmp-server
# --------------------- EMPTY -----------------
# Using state: overridden
# Before state:
# -------------
# router-ios#show running-config | section ^snmp-server
# snmp-server engineID remote 172.16.0.12 udp-port 25 AB0C5342FF0F
# snmp-server user userPaul dev v1 access 24
# snmp-server group mergedGroup v3 auth
# snmp-server community mergedComm RW testACL
# snmp-server contact contact updated using merged
# snmp-server enable traps tty
# snmp-server enable traps ospf state-change
# snmp-server enable traps ospf errors
# snmp-server enable traps ospf retransmit
# snmp-server enable traps ospf lsa
# snmp-server enable traps ospf cisco-specific state-change nssa-trans-change
# snmp-server enable traps ospf cisco-specific state-change shamlink interface
# snmp-server enable traps ospf cisco-specific state-change shamlink neighbor
# snmp-server enable traps ospf cisco-specific errors
# snmp-server enable traps ospf cisco-specific retransmit
# snmp-server enable traps ospf cisco-specific lsa
# snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency
# snmp-server enable traps msdp
# snmp-server enable traps syslog
# snmp-server host 172.16.2.9 informs version 2c mergedComm msdp stun pki
# snmp-server host 172.16.2.9 mergedComm slb pki
# snmp-server file-transfer access-group test protocol ftp
# snmp-server password-policy MergedPolicy define max-len 24 upper-case 12 lower-case 12 special-char 32 digits 23 change 3
# snmp-server password-policy MergedPolicy2 define min-len 12 upper-case 12 special-char 22 change 43
# snmp-server password-policy policy3 define min-len 12 max-len 12 upper-case 12 special-char 22 digits 23 change 11
# Overridden play:
# ----------------
- name: Override commands with provided configuration
cisco.ios.ios_snmp_server:
config:
location: "location entry for snmp"
packet_size: 500
communities:
- acl_v4: acl_uq
name: communityOverriden
rw: true
state: overridden
# Commands Fired:
# ---------------
# "commands": [
# "no snmp-server contact contact updated using merged",
# "no snmp-server file-transfer access-group test protocol ftp",
# "snmp-server location location entry for snmp",
# "snmp-server packetsize 500",
# "no snmp-server enable traps msdp",
# "no snmp-server enable traps syslog",
# "no snmp-server enable traps tty",
# "no snmp-server enable traps ospf cisco-specific errors",
# "no snmp-server enable traps ospf cisco-specific retransmit",
# "no snmp-server enable traps ospf cisco-specific lsa",
# "no snmp-server enable traps ospf cisco-specific state-change nssa-trans-change",
# "no snmp-server enable traps ospf cisco-specific state-change shamlink interface",
# "no snmp-server enable traps ospf cisco-specific state-change shamlink neighbor",
# "no snmp-server enable traps ospf errors",
# "no snmp-server enable traps ospf retransmit",
# "no snmp-server enable traps ospf lsa",
# "no snmp-server enable traps ospf state-change",
# "no snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency",
# "no snmp-server host 172.16.2.9 informs version 2c mergedComm msdp stun pki",
# "no snmp-server host 172.16.2.9 mergedComm slb pki",
# "no snmp-server group mergedGroup v3 auth",
# "no snmp-server engineID remote 172.16.0.12 udp-port 25 AB0C5342FF0F",
# "snmp-server community communityOvverriden rw acl_uq",
# "no snmp-server community mergedComm rw testACL",
# "no snmp-server password-policy MergedPolicy define max-len 24 upper-case 12 lower-case 12 special-char 32 digits 23 change 3",
# "no snmp-server password-policy MergedPolicy2 define min-len 12 upper-case 12 special-char 22 change 43",
# "no snmp-server password-policy policy3 define min-len 12 max-len 12 upper-case 12 special-char 22 digits 23 change 11",
# "no snmp-server user userPaul dev v1 access 24"
# ],
# After state:
# ------------
# router-ios#show running-config | section ^snmp-server
# snmp-server community communityOverriden RW acl_uq
# snmp-server packetsize 500
# snmp-server location location entry for snmp
# Using state: replaced
# Before state:
# -------------
# router-ios#show running-config | section ^snmp-server
# snmp-server community communityOverriden RW acl_uq
# snmp-server packetsize 500
# snmp-server location location entry for snmp
# Replaced play:
# --------------
- name: Replace commands with provided configuration
cisco.ios.ios_snmp_server:
config:
location: "updated location entry"
packet_size: 500
communities:
- acl_v4: acl_uq
name: communityOverriden
rw: true
state: replaced
# Commands Fired:
# ---------------
# "commands": [
# "snmp-server location updated location entry"
# ],
# After state:
# ------------
# router-ios#show running-config | section ^snmp-server
# snmp-server community communityOverriden RW acl_uq
# snmp-server packetsize 500
# snmp-server location updated location entry
# Using state: gathered
# Before state:
# -------------
# router-ios#show running-config | section ^snmp-server
# snmp-server engineID remote 172.16.0.12 udp-port 25 AB0C5342FF0F
# snmp-server user userPaul dev v1 access 24
# snmp-server group mergedGroup v3 auth
# snmp-server community communityOvverriden RW acl_uq
# snmp-server community mergedComm RW testACL
# snmp-server packetsize 500
# snmp-server location updated location entry
# snmp-server contact contact updated using merged
# snmp-server enable traps tty
# snmp-server enable traps ospf state-change
# snmp-server enable traps ospf errors
# snmp-server enable traps ospf retransmit
# snmp-server enable traps ospf lsa
# snmp-server enable traps ospf cisco-specific state-change nssa-trans-change
# snmp-server enable traps ospf cisco-specific state-change shamlink interface
# snmp-server enable traps ospf cisco-specific state-change shamlink neighbor
# snmp-server enable traps ospf cisco-specific errors
# snmp-server enable traps ospf cisco-specific retransmit
# snmp-server enable traps ospf cisco-specific lsa
# snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency
# snmp-server enable traps msdp
# snmp-server enable traps syslog
# snmp-server host 172.16.2.9 informs version 2c mergedComm msdp stun pki
# snmp-server host 172.16.2.9 mergedComm slb pki
# snmp-server file-transfer access-group test protocol ftp
# snmp-server password-policy MergedPolicy define max-len 24 upper-case 12 lower-case 12 special-char 32 digits 23 change 3
# snmp-server password-policy MergedPolicy2 define min-len 12 upper-case 12 special-char 22 change 43
# snmp-server password-policy policy3 define min-len 12 max-len 12 upper-case 12 special-char 22 digits 23 change 11
# Gathered play:
# --------------
- name: Gather listed snmp config
cisco.ios.ios_snmp_server:
state: gathered
# Module Execution Result:
# ------------------------
# "gathered": {
# "communities": [
# {
# "acl_v4": "acl_uq",
# "name": "communityOvverriden",
# "rw": true
# },
# {
# "acl_v4": "testACL",
# "name": "mergedComm",
# "rw": true
# }
# ],
# "contact": "contact updated using merged",
# "engine_id": [
# {
# "id": "AB0C5342FF0F",
# "remote": {
# "host": "172.16.0.12",
# "udp_port": 25
# }
# }
# ],
# "file_transfer": {
# "access_group": "test",
# "protocol": [
# "ftp"
# ]
# },
# "groups": [
# {
# "group": "mergedGroup",
# "version": "v3",
# "version_option": "auth"
# }
# ],
# "hosts": [
# {
# "community_string": "mergedComm",
# "host": "172.16.2.9",
# "informs": true,
# "traps": [
# "msdp",
# "stun",
# "pki"
# ],
# "version": "2c"
# },
# {
# "community_string": "mergedComm",
# "host": "172.16.2.9",
# "traps": [
# "slb",
# "pki"
# ]
# }
# ],
# "location": "updated location entry",
# "packet_size": 500,
# "password_policy": [
# {
# "change": 3,
# "digits": 23,
# "lower_case": 12,
# "max_len": 24,
# "policy_name": "MergedPolicy",
# "special_char": 32,
# "upper_case": 12
# },
# {
# "change": 43,
# "min_len": 12,
# "policy_name": "MergedPolicy2",
# "special_char": 22,
# "upper_case": 12
# },
# {
# "change": 11,
# "digits": 23,
# "max_len": 12,
# "min_len": 12,
# "policy_name": "policy3",
# "special_char": 22,
# "upper_case": 12
# }
# ],
# "traps": {
# "cef": {
# "enable": true,
# "inconsistency": true,
# "peer_fib_state_change": true,
# "peer_state_change": true,
# "resource_failure": true
# },
# "msdp": true,
# "ospf": {
# "cisco_specific": {
# "error": true,
# "lsa": true,
# "retransmit": true,
# "state_change": {
# "nssa_trans_change": true,
# "shamlink": {
# "interface": true,
# "neighbor": true
# }
# }
# },
# "error": true,
# "lsa": true,
# "retransmit": true,
# "state_change": true
# },
# "syslog": true,
# "tty": true
# },
# "users": [
# {
# "acl_v4": "24",
# "group": "dev",
# "username": "userPaul",
# "version": "v1"
# }
# ]
# },
# Using state: rendered
# Rendered play:
# --------------
- name: Render the commands for provided configuration
cisco.ios.ios_snmp_server:
config:
accounting:
command: default
cache: 2
chassis_id: entry for chassis id
communities:
- acl_v6: te
name: test
ro: true
view: terst1
- acl_v4: "1322"
name: wete
ro: true
- acl_v4: paul
name: weteww
rw: true
contact: details contact
context:
- contextA
- contextB
engine_id:
- id: AB0C5342FA0A
local: true
- id: AB0C5342FAAB
remote:
host: 172.16.0.2
udp_port: 23
- id: AB0C5342FAAA
remote:
host: 172.16.0.1
udp_port: 22
file_transfer:
access_group: testAcl
protocol:
- ftp
- rcp
groups:
- group: grpFamily
version: v3
version_option: auth
- context: mycontext
group: grpFamily
version: v1
- acl_v4: "2"
group: grp1
notify: me
version: v1
- group: newtera
version: v3
version_option: priv
- group: relaplacing
version: v3
version_option: noauth
hosts:
- community_string: check
host: 172.16.2.99
informs: true
traps:
- msdp
- stun
version: 2c
- community_string: check
host: 172.16.2.99
traps:
- slb
- pki
- community_string: checktrap
host: 172.16.2.99
traps:
- isis
- hsrp
- community_string: newtera
host: 172.16.2.1
traps:
- rsrb
- pim
- rsvp
- slb
- pki
version: "3"
version_option: priv
- community_string: relaplacing
host: 172.16.2.1
traps:
- slb
- pki
version: "3"
version_option: noauth
- community_string: trapsac
host: 172.16.2.1
traps:
- tty
- bgp
version: 2c
- community_string: www
host: 172.16.1.1
traps:
- tty
- bgp
version: "3"
version_option: auth
inform:
pending: 2
ip:
dscp: 2
location: "entry for snmp location"
packet_size: 500
password_policy:
- change: 3
digits: 23
lower_case: 12
max_len: 24
policy_name: policy1
special_char: 32
upper_case: 12
- change: 9
min_len: 12
policy_name: policy2
special_char: 22
upper_case: 12
- change: 11
digits: 23
max_len: 12
min_len: 12
policy_name: policy3
special_char: 22
upper_case: 12
queue_length: 2
source_interface: Loopback999
system_shutdown: true
trap_source: GigabitEthernet0/0
trap_timeout: 2
traps:
auth_framework:
enable: true
bgp:
cbgp2: true
enable: true
bfd:
enable: true
session_down: true
session_up: true
bridge:
enable: true
newroot: true
topologychange: true
casa: true
cef:
enable: true
inconsistency: true
peer_fib_state_change: true
peer_state_change: true
resource_failure: true
dlsw:
enable: true
eigrp: true
ethernet:
cfm:
alarm: true
evc:
status: true
event_manager: true
flowmon: true
frame_relay:
enable: true
subif:
enable: true
hsrp: true
ike:
policy:
add: true
delete: true
tunnel:
start: true
stop: true
ipmulticast: true
ipsec:
cryptomap:
add: true
attach: true
delete: true
detach: true
too_many_sas: true
tunnel:
start: true
stop: true
ipsla: true
l2tun:
pseudowire_status: true
session: true
msdp: true
ospf:
cisco_specific:
error: true
lsa: true
retransmit: true
state_change:
nssa_trans_change: true
shamlink:
interface: true
neighbor: true
error: true
lsa: true
retransmit: true
state_change: true
pim:
enable: true
invalid_pim_message: true
neighbor_change: true
rp_mapping_change: true
pki: true
rsvp: true
snmp:
authentication: true
coldstart: true
linkdown: true
linkup: true
warmstart: true
syslog: true
tty: true
users:
- acl_v4: "24"
group: groupFamily
username: paul
version: v1
- acl_v4: ipv6
group: groupFamily
username: domnic
version: v3
- group: relaplacing
username: relaplacing
version: v3
state: rendered
# Module Execution Result:
# ------------------------
# "rendered": [
# "snmp-server accounting commands default",
# "snmp-server cache interval 2",
# "snmp-server chassis-id entry for chassis id",
# "snmp-server contact details contact",
# "snmp-server file-transfer access-group testAcl protocol ftp rcp",
# "snmp-server inform pending 2",
# "snmp-server ip dscp 2",
# "snmp-server location entry for snmp location",
# "snmp-server packetsize 500",
# "snmp-server queue-length 2",
# "snmp-server trap timeout 2",
# "snmp-server source-interface informs Loopback999",
# "snmp-server trap-source GigabitEthernet0/0",
# "snmp-server system-shutdown",
# "snmp-server enable traps auth-framework",
# "snmp-server enable traps bfd session-down session-up",
# "snmp-server enable traps bgp cbgp2",
# "snmp-server enable traps bridge newroot topologychange",
# "snmp-server enable traps casa",
# "snmp-server enable traps eigrp",
# "snmp-server enable traps event-manager",
# "snmp-server enable traps flowmon",
# "snmp-server enable traps hsrp",
# "snmp-server enable traps ipsla",
# "snmp-server enable traps msdp",
# "snmp-server enable traps pki",
# "snmp-server enable traps rsvp",
# "snmp-server enable traps syslog",
# "snmp-server enable traps tty",
# "snmp-server enable traps ipmulticast",
# "snmp-server enable traps ike policy add",
# "snmp-server enable traps ike policy delete",
# "snmp-server enable traps ike tunnel start",
# "snmp-server enable traps ike tunnel stop",
# "snmp-server enable traps ipsec cryptomap add",
# "snmp-server enable traps ipsec cryptomap delete",
# "snmp-server enable traps ipsec cryptomap attach",
# "snmp-server enable traps ipsec cryptomap detach",
# "snmp-server enable traps ipsec tunnel start",
# "snmp-server enable traps ipsec tunnel stop",
# "snmp-server enable traps ipsec too-many-sas",
# "snmp-server enable traps ospf cisco-specific errors",
# "snmp-server enable traps ospf cisco-specific retransmit",
# "snmp-server enable traps ospf cisco-specific lsa",
# "snmp-server enable traps ospf cisco-specific state-change nssa-trans-change",
# "snmp-server enable traps ospf cisco-specific state-change shamlink interface",
# "snmp-server enable traps ospf cisco-specific state-change shamlink neighbor",
# "snmp-server enable traps ospf errors",
# "snmp-server enable traps ospf retransmit",
# "snmp-server enable traps ospf lsa",
# "snmp-server enable traps ospf state-change",
# "snmp-server enable traps l2tun pseudowire status",
# "snmp-server enable traps l2tun session",
# "snmp-server enable traps pim neighbor-change rp-mapping-change invalid-pim-message",
# "snmp-server enable traps snmp authentication linkdown linkup warmstart coldstart",
# "snmp-server enable traps frame-relay",
# "snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency",
# "snmp-server enable traps dlsw",
# "snmp-server enable traps ethernet evc status",
# "snmp-server enable traps ethernet cfm alarm",
# "snmp-server host 172.16.2.99 informs version 2c check msdp stun",
# "snmp-server host 172.16.2.99 check slb pki",
# "snmp-server host 172.16.2.99 checktrap isis hsrp",
# "snmp-server host 172.16.2.1 version 3 priv newtera rsrb pim rsvp slb pki",
# "snmp-server host 172.16.2.1 version 3 noauth relaplacing slb pki",
# "snmp-server host 172.16.2.1 version 2c trapsac tty bgp",
# "snmp-server host 172.16.1.1 version 3 auth www tty bgp",
# "snmp-server group grpFamily v1 context mycontext",
# "snmp-server group grp1 v1 notify me access 2",
# "snmp-server group newtera v3 priv",
# "snmp-server group relaplacing v3 noauth",
# "snmp-server engineID local AB0C5342FA0A",
# "snmp-server engineID remote 172.16.0.2 udp-port 23 AB0C5342FAAB",
# "snmp-server engineID remote 172.16.0.1 udp-port 22 AB0C5342FAAA",
# "snmp-server community test view terst1 ro ipv6 te",
# "snmp-server community wete ro 1322",
# "snmp-server community weteww rw paul",
# "snmp-server context contextA",
# "snmp-server context contextB",
# "snmp-server password-policy policy1 define max-len 24 upper-case 12 lower-case 12 special-char 32 digits 23 change 3",
# "snmp-server password-policy policy2 define min-len 12 upper-case 12 special-char 22 change 9",
# "snmp-server password-policy policy3 define min-len 12 max-len 12 upper-case 12 special-char 22 digits 23 change 11",
# "snmp-server user paul groupFamily v1 access 24",
# "snmp-server user domnic groupFamily v3 access ipv6",
# "snmp-server user relaplacing relaplacing v3"
# ]
# Using state: parsed
# File: parsed.cfg
# ----------------
# snmp-server engineID local AB0C5342FA0A
# snmp-server engineID remote 172.16.0.2 udp-port 23 AB0C5342FAAB
# snmp-server engineID remote 172.16.0.1 udp-port 22 AB0C5342FAAA
# snmp-server user newuser newfamily v1 access 24
# snmp-server user paul familypaul v3 access ipv6 ipv6acl
# snmp-server user replaceUser replaceUser v3
# snmp-server group group0 v3 auth
# snmp-server group group1 v1 notify me access 2
# snmp-server group group2 v3 priv
# snmp-server group replaceUser v3 noauth
# snmp-server community commu1 view view1 RO ipv6 te
# snmp-server community commu2 RO 1322
# snmp-server community commu3 RW paul
# snmp-server trap timeout 2
# snmp-server trap-source GigabitEthernet0/0
# snmp-server source-interface informs Loopback999
# snmp-server packetsize 500
# snmp-server enable traps vrfmib vrf-up vrf-down vnet-trunk-up vnet-trunk-down
# snmp-server host 172.16.2.99 informs version 2c check msdp stun
# snmp-server host 172.16.2.1 version 2c trapsac tty bgp
# snmp-server host 172.16.1.1 version 3 auth group0 tty bgp
# snmp-server context contextWord1
# snmp-server context contextWord2
# snmp-server file-transfer access-group testAcl protocol ftp
# snmp-server file-transfer access-group testAcl protocol rcp
# snmp-server cache interval 2
# snmp-server password-policy policy2 define min-len 12 upper-case 12 special-char 22 change 9
# snmp-server password-policy policy3 define min-len 12 max-len 12 upper-case 12 special-char 22 digits 23 change 11
# snmp-server accounting commands default
# snmp-server inform pending 2
# Parsed play:
# ------------
- name: Parse the provided configuration with the existing running configuration
cisco.ios.ios_snmp_server:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": {
# "accounting": {
# "command": "default"
# },
# "cache": 2,
# "communities": [
# {
# "acl_v6": "te",
# "name": "commu1",
# "ro": true,
# "view": "view1"
# },
# {
# "acl_v4": "1322",
# "name": "commu2",
# "ro": true
# },
# {
# "acl_v4": "paul",
# "name": "commu3",
# "rw": true
# }
# ],
# "context": [
# "contextWord1",
# "contextWord2"
# ],
# "engine_id": [
# {
# "id": "AB0C5342FA0A",
# "local": true
# },
# {
# "id": "AB0C5342FAAA",
# "remote": {
# "host": "172.16.0.1",
# "udp_port": 22
# }
# },
# {
# "id": "AB0C5342FAAB",
# "remote": {
# "host": "172.16.0.2",
# "udp_port": 23
# }
# }
# ],
# "file_transfer": {
# "access_group": "testAcl",
# "protocol": [
# "rcp",
# "ftp"
# ]
# },
# "groups": [
# {
# "group": "group0",
# "version": "v3",
# "version_option": "auth"
# },
# {
# "acl_v4": "2",
# "group": "group1",
# "notify": "me",
# "version": "v1"
# },
# {
# "group": "group2",
# "version": "v3",
# "version_option": "priv"
# },
# {
# "group": "replaceUser",
# "version": "v3",
# "version_option": "noauth"
# }
# ],
# "hosts": [
# {
# "community_string": "group0",
# "host": "172.16.1.1",
# "traps": [
# "tty",
# "bgp"
# ],
# "version": "3",
# "version_option": "auth"
# },
# {
# "community_string": "trapsac",
# "host": "172.16.2.1",
# "traps": [
# "tty",
# "bgp"
# ],
# "version": "2c"
# },
# {
# "community_string": "check",
# "host": "172.16.2.99",
# "informs": true,
# "traps": [
# "msdp",
# "stun"
# ],
# "version": "2c"
# }
# ],
# "inform": {
# "pending": 2
# },
# "packet_size": 500,
# "password_policy": [
# {
# "change": 9,
# "min_len": 12,
# "policy_name": "policy2",
# "special_char": 22,
# "upper_case": 12
# },
# {
# "change": 11,
# "digits": 23,
# "max_len": 12,
# "min_len": 12,
# "policy_name": "policy3",
# "special_char": 22,
# "upper_case": 12
# }
# ],
# "source_interface": "Loopback999",
# "trap_source": "GigabitEthernet0/0",
# "trap_timeout": 2,
# "traps": {
# "vrfmib": {
# "vnet_trunk_down": true,
# "vnet_trunk_up": true,
# "vrf_down": true,
# "vrf_up": true
# }
# },
# "users": [
# {
# "acl_v4": "24",
# "group": "newfamily",
# "username": "newuser",
# "version": "v1"
# },
# {
# "acl_v4": "ipv6",
# "group": "familypaul",
# "username": "paul",
# "version": "v3"
# },
# {
# "group": "replaceUser",
# "username": "replaceUser",
# "version": "v3"
# }
# ]
# }
返回值
常见的返回值已在此处记录,以下是此模块特有的字段
键 |
描述 |
---|---|
模块执行后的结果配置。 返回:发生更改时 示例: |
|
模块执行之前的配置。 返回:当*state*为 示例: |
|
推送到远程设备的命令集。 返回:当*state*为 示例: |
|
从远程设备收集到的网络资源信息,以结构化数据形式呈现。 返回:当*state*为 示例: |
|
根据模块argspec将*running_config*选项中提供的设备原生配置解析为结构化数据。 返回:当状态为 示例: |
|
任务中提供的配置以设备原生格式(离线)渲染。 返回:当状态为 示例: |