cisco.iosxr.iosxr_snmp_server module – Resource module to configure snmp server.
Note
This module is part of the cisco.iosxr collection (version 4.1.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install cisco.iosxr
.
To use it in a playbook, specify: cisco.iosxr.iosxr_snmp_server
.
New in cisco.iosxr 2.6.0
Synopsis
This module configures and manages the attributes of snmp-server on Cisco IOSXR platforms.
Parameters
Parameter |
Comments |
---|---|
SNMP server configuration. |
|
SNMP chassis identifier. |
|
Enable SNMP; set community string and access privileges. |
|
Ipv4 access list. |
|
IPv6 access list name. |
|
Community name. |
|
Only reads are permitted. Choices:
|
|
Read-write access. Choices:
|
|
SDR Owner permissions for MIB Objects. Choices:
|
|
System Owner permissions for MIB objects. Choices:
|
|
V4 Access-list name. |
|
Community Mapping as per RFC-2576. |
|
Context Name for the community mapping. |
|
Community name |
|
Security Name for the community mapping. |
|
list of targets valid with this community. |
|
Person to contact about the syste,. |
|
Create/Delete a context apart from default |
|
Configure properties of the event correlator |
|
Configure size of the correlator buffer. |
|
Configure a specified correlation ruleset. |
|
Name of the ruleset |
|
Configure a specified correlation rule. |
|
name of rule. |
|
Specify timeout. |
|
Silently drop SNMP packets |
|
Config to drop snmpv3 error reports matching Ipv4 ACL. |
|
Config to drop snmpv3 error reports matching Ipv4 ACL. |
|
Silently drop unknown v3 user packets Choices:
|
|
SNMPv3 engine ID configuration. |
|
Local SNMP agent |
|
SNMP USM group |
|
Ipv4 Type of Access-list |
|
Ipv6 Type of Access-list |
|
Specify a context to associate with the group |
|
SNMP group for the user |
|
View to restrict notifications |
|
View to restrict read access |
|
V4 Access-list name |
|
snmp security group version Choices:
|
|
View to restrict write access |
|
Notification destinations |
|
community string. |
|
Hostname or IP address of SNMP notification host. |
|
Use SNMP inform messages. Choices:
|
|
Use SNMP trap messages Choices:
|
|
UDP destination port for notification messages. |
|
Notification message SNMP version. Choices:
|
|
Enable ifindex persistence Choices:
|
|
IF-MIB configuration commands. |
|
Modify parameters for ifAlias object. Choices:
|
|
IFMIB internal lookahead cache. |
|
Enable ipsubscriber interfaces in IFMIB. Choices:
|
|
Modify IF-MIB statistics parameters. Choices:
|
|
Configure SNMP Informs options |
|
Set number of unacked informs to hold |
|
Set retry count for informs |
|
Set timeout for informs |
|
Enter the SNMP interface configuration commands. |
|
Configure ifIndex attributes Persistency across system reloads. Choices:
|
|
Name of interface. |
|
Disable linkUp and linkDown notification. Choices:
|
|
Mark the dscp/precedence bit for ipv4 packets. |
|
Set IP DSCP (DiffServ CodePoint).Please refer vendor document for valid entries. |
|
Set precedence Please refer vendor document for valid entries. |
|
Mark the dscp/precedence bit for ipv4 packets. |
|
Set IP DSCP (DiffServ CodePoint).Please refer vendor document for valid entries. |
|
Set precedence Please refer vendor document for valid entries. |
|
The sysLocation string. |
|
Configure threshold to start logging slow OID requests processing. |
|
Configure threshold to start logging slow PDU requests processing. |
|
per process memory limit in kilo bytes |
|
mib bulkstat transfer ids. |
|
Bulkstat data file maximum size. |
|
Start Data Collection for this Configuration Choices:
|
|
format Choices:
|
|
mib transfer-id name. |
|
Retention period in Min. |
|
Number of Retries. |
|
Schema that contains objects to be collected. |
|
transfer-interval |
|
mib object lists |
|
mib schema |
|
mib schema name. |
|
Name of an object List. |
|
Periodicity for polling of objects in this schema in Min. |
|
Configurations related to IPMROUTE-MIB(cisco-support). Choices:
|
|
notification log mib. |
|
To create a default log Choices:
|
|
disable, to disable the logging in default log. Choices:
|
|
GlobalSize, max number of notifications that can be logged in all logs. |
|
size, The max number of notifications that this log (default) can hold. |
|
Enable OID poll stats oper CLI Choices:
|
|
Set overload-control params for handling incoming messages in critical processing mode. |
|
Overload drop time (in seconds) for incoming queue (default 1 sec). |
|
Overload throttle rate for incoming queue (default 500 msec) |
|
Largest SNMP packet size. |
|
Queue length (default 100). |
|
targets |
|
Specify host name. |
|
Name of the target list. |
|
Specify VRF name. |
|
Set throttle time for handling incoming messages. |
|
SNMP timeouts |
|
Duplicate request feature timeout |
|
incoming queue drop feature. |
|
SNMP pdu statistics end to end. |
|
Sub-Agent Request timeout. |
|
threshold incoming queue drop feature. |
|
MIB trap configurations. |
|
Disable authentication traps for packets on a vrf. Choices:
|
|
Link up/down trap configuratio. Choices:
|
|
Set throttle time for handling more traps. |
|
Assign an interface for the source address of all traps |
|
Set timeout for TRAP message retransmissions |
|
Enable traps to all configured recipients. |
|
Enable SNMP Address Pool traps. |
|
Enable SNMP Address Pool High Threshold trap. Choices:
|
|
Enable SNMP Address Pool Low Threshold trap. Choices:
|
|
Enable BFD traps. Choices:
|
|
Enable Bgp traps. |
|
Enable CISCO-BGP4-MIB v2 traps. Choices:
|
|
Enable CISCO-BGP4-MIB v2 up/down traps. Choices:
|
|
Enable SNMP Trap for Bridge MIB. Choices:
|
|
Enable Data-Collection-MIB Collection notifications. Choices:
|
|
Enable Data-Collection-MIB Trnasfer notifications. Choices:
|
|
Enable SNMP entity traps Choices:
|
|
Enable SNMP config traps. Choices:
|
|
Enable CISCO-CONFIG-COPY-MIB ccCopyCompletion traps. Choices:
|
|
Enable SNMP diameter traps. |
|
Enable peer connection down notification. Choices:
|
|
Enable peer connection up notification. Choices:
|
|
Enable permanent failure notification. Choices:
|
|
Enable protocol error notifications Choices:
|
|
Enable transient failure notification. Choices:
|
|
Enable SNMP entity traps. Choices:
|
|
Enable SNMP CISCO-ENTITY-REDUNDANCY-MIB traps. |
|
Enable all CISCO-ENTITY-REDUNDANCY-MIB traps Choices:
|
|
Enable status change traps Choices:
|
|
Enable switchover traps. Choices:
|
|
Enable SNMP entity-state traps. |
|
Enable entity oper status enable notification. Choices:
|
|
Enable entity state switchover notifications Choices:
|
|
Enable flash-mib traps. |
|
Enable ciscoFlashDeviceInsertedNotif. Choices:
|
|
Enable ciscoFlashDeviceRemovedNotif. Choices:
|
|
Enable SNMP entity FRU control traps. Choices:
|
|
Enable SNMP hsrp traps. Choices:
|
|
Enable SNMP IPSec traps. |
|
Enable SNMP IPsec Tunnel Start trap. Choices:
|
|
Enable SNMP IPsec Tunnel Stop trap. Choices:
|
|
Enable SNMP hipsla traps. Choices:
|
|
Enable SNMP isakmp traps. |
|
Enable SNMP isakmp Tunnel Start trap. Choices:
|
|
Enable SNMP isakmp Tunnel Stop trap. Choices:
|
|
Enable isis traps. If set to enabled , all the traps are set. |
|
adjacency-change Choices:
|
|
anable all is-is traps. Choices:
|
|
area-mismatch Choices:
|
|
attempt-to-exceed-max-sequence Choices:
|
|
authentication-failure. Choices:
|
|
authentication-type-failure. Choices:
|
|
isisCorruptedLSPDetected Choices:
|
|
database-overload Choices:
|
|
isisIDLenMismatch Choices:
|
|
lsp-error-detected. Choices:
|
|
lsp-too-large-to-propagate Choices:
|
|
manual_address_drops Choices:
|
|
max_area_addresses_mismatch Choices:
|
|
orig-lsp-buff-size-mismatch Choices:
|
|
own-lsp-purge Choices:
|
|
protocols-supported-mismatch Choices:
|
|
rejected-adjacency Choices:
|
|
sequence-number-skip. Choices:
|
|
version-skew Choices:
|
|
Enable L2TUN traps. |
|
Enable L2TUN pseudowire status traps. Choices:
|
|
Enable L2TUN sessions traps. Choices:
|
|
Enable L2TUN tunnel DOWN traps. Choices:
|
|
Enable L2TUN tunnel UP traps. Choices:
|
|
Enable L2VPN traps. |
|
Enable L2VPN ALL traps. Choices:
|
|
Enable L2VPN CISCO traps. Choices:
|
|
Enable L2VPN VC DOWN traps. Choices:
|
|
Enable L2VPN VC UP traps. Choices:
|
|
Enable SNMP MSDP traps Choices:
|
|
Enable SNMP Cisco Ntp traps. Choices:
|
|
Enable Ospf traps. If set to enabled , all the traps are set. |
|
error |
|
authentication-failure. Choices:
|
|
bad-packet Choices:
|
|
config-error Choices:
|
|
virt-authentication-failure Choices:
|
|
virt-bad-packet Choices:
|
|
virt_config_error Choices:
|
|
lsa |
|
lsa-maxage Choices:
|
|
lsa-originate Choices:
|
|
retransmit |
|
packets Choices:
|
|
virt-packets Choices:
|
|
state-change. |
|
if-state-change Choices:
|
|
neighbor-state-change Choices:
|
|
virtif-state-change Choices:
|
|
virtneighbor-state-change Choices:
|
|
Enable Ospfv3 traps. If set to enabled , all the traps are set. |
|
error |
|
bad-packet Choices:
|
|
config-error Choices:
|
|
virt-bad-packet Choices:
|
|
virt_config_error Choices:
|
|
state-change. |
|
if-state-change Choices:
|
|
neighbor-state-change Choices:
|
|
nssa-state-change Choices:
|
|
restart-helper-status-change Choices:
|
|
restart-status-change Choices:
|
|
restart-virtual-helper-status-change Choices:
|
|
virtif-state-change Choices:
|
|
virtneighbor-state-change Choices:
|
|
Enable Pim traps. If set to enabled , all the traps are set. |
|
interface-state-change . Choices:
|
|
invalid-message-received Choices:
|
|
neighbor-change. Choices:
|
|
rp-mapping-change. Choices:
|
|
Enable SNMP entity power traps. Choices:
|
|
Enable SNMP RF-MIB traps. Choices:
|
|
Enable rsvp traps. If set to enabled , all the traps are set. |
|
enable all traps. Choices:
|
|
lost-flow Choices:
|
|
new-flow Choices:
|
|
Enable selective VRF download traps. Choices:
|
|
Enable SNMP entity sensor traps Choices:
|
|
Enable snmp traps. If set to enabled , all the traps are set. |
|
authentication Choices:
|
|
coldstart. Choices:
|
|
link-down Choices:
|
|
link-up Choices:
|
|
warmstart. Choices:
|
|
Subscriber notification commands. |
|
Subscriber notification at access interface level Choices:
|
|
Subscriber notification at node level Choices:
|
|
syslog Choices:
|
|
Enable SNMP SYSTEMMIB-MIB traps. Choices:
|
|
Enable VPLS traps |
|
Enable all VPLS traps. Choices:
|
|
Enable VPLS Full Clear traps. Choices:
|
|
Enable VPLS Full Raise traps. Choices:
|
|
Enable VPLS Status traps Choices:
|
|
vrrp Choices:
|
|
SNMP user configuration. |
|
Ipv4 Type of Access-list |
|
Ipv6 Type of Access-list |
|
SNMP group for the user. |
|
SDR Owner permissions for MIB Objects. Choices:
|
|
System Owner permissions for MIB objects. Choices:
|
|
SNMP user name |
|
V4 Access-list name |
|
snmp security version Choices:
|
|
Specify the VRF in which the source address is used |
|
Configure the source interface for SNMP notifications |
|
Notification destinations |
|
community string. |
|
Hostname or IP address of SNMP notification host. |
|
Use SNMP inform messages. Choices:
|
|
Use SNMP trap messages Choices:
|
|
UDP destination port for notification messages. |
|
Notification message SNMP version. Choices:
|
|
vrf name. |
|
This option is used only with state parsed. The value of this option should be the output received from the IOSXR device by executing the command show running-config snmp-server. The state parsed reads the configuration from |
|
The state the configuration should be left in. The states replaced and overridden have identical behaviour for this module. Please refer to examples for more details. Choices:
|
Notes
Note
Tested against Cisco Iosxr 7.0.2
This module works with connection
network_cli
.
Examples
# Using state: merged
# Before state:
# -------------
# RP/0/RP0/CPU0:test2#show running-config snmp-server
# --------------------- EMPTY -----------------
# Merged play:
# ------------
- name: Merge the provided configuration with the existing running configuration
cisco.iosxr.iosxr_snmp_server:
config:
vrfs:
- hosts:
- community: test1
host: 1.1.1.1
traps: true
vrf: vrf1
users:
- Ipv4_acl: test1
Ipv6_acl: test2
group: test2
user: u1
version: v1
timeouts:
duplicate: 0
inQdrop: 0
trap:
throttle_time: 12
targets:
- host: 1.1.1.2
name: test
ifmib:
internal_cache_max_duration: 4
inform:
retries: 7
chassis_id: test2
packetsize: 490
queue_length: 2
throttle_time: 60
trap_source: GigabitEthernet0/0/0/2
trap_timeout: 3
context:
- c1
- c2
contact: t1
correlator:
buffer_size: 1024
communities:
- name: test2
ro: true
sdrowner: true
acl_v4: test
acl_v6: test1
community_maps:
- name: cm1
context: c1
target_list: t1
security_name: s1
drop:
report_IPv4: test1
unknown_user: true
ipv6:
precedence: routine
ipv4:
dscp: af11
location: test1
logging_threshold_oid_processing: 1
logging_threshold_pdu_processing: 1
mib_bulkstat_max_procmem_size: 101
mroutemib_send_all_vrf: true
overload_control:
overload_drop_time: 4
overload_throttle_rate: 6
notification_log_mib:
GlobalSize: 5
size: 5
traps:
hsrp: true
ipsla: true
ipsec:
start: true
stop: true
bridgemib: true
bulkstat_collection: true
cisco_entity_ext: true
config: true
copy_complete: true
addrpool:
high: true
low: true
bfd: true
bgp:
cbgp2: true
l2tun:
sessions: true
tunnel_down: true
tunnel_up: true
l2vpn:
all: true
vc_down: true
vc_up: true
msdp_peer_state_change: true
#
# Commands Fired:
# ------------
# "commands": [
# "snmp-server chassis-id test2",
# "snmp-server correlator buffer-size 1024",
# "snmp-server contact t1",
# "snmp-server ipv4 dscp af11",
# "snmp-server ipv6 precedence routine",
# "snmp-server location test1",
# "snmp-server logging threshold oid-processing 1",
# "snmp-server logging threshold pdu-processing 1",
# "snmp-server mib bulkstat max-procmem-size 101",
# "snmp-server mroutemib send-all-vrf",
# "snmp-server overload-control 4 6",
# "snmp-server packetsize 490",
# "snmp-server queue-length 2",
# "snmp-server throttle-time 60",
# "snmp-server trap-source GigabitEthernet0/0/0/2",
# "snmp-server trap-timeout 3",
# "snmp-server drop report acl IPv4 test1",
# "snmp-server drop unknown-user",
# "snmp-server ifmib internal cache max-duration 4",
# "snmp-server inform retries 7",
# "snmp-server notification-log-mib size 5",
# "snmp-server notification-log-mib GlobalSize 5",
# "snmp-server trap throttle-time 12",
# "snmp-server timeouts inQdrop 0",
# "snmp-server timeouts duplicate 0",
# "snmp-server traps addrpool low",
# "snmp-server traps addrpool high",
# "snmp-server traps bfd",
# "snmp-server traps bgp cbgp2",
# "snmp-server traps bulkstat collection",
# "snmp-server traps bridgemib",
# "snmp-server traps copy-complete",
# "snmp-server traps cisco-entity-ext",
# "snmp-server traps config",
# "snmp-server traps hsrp",
# "snmp-server traps ipsla",
# "snmp-server traps ipsec tunnel start",
# "snmp-server traps ipsec tunnel stop",
# "snmp-server traps l2tun sessions",
# "snmp-server traps l2tun tunnel-up",
# "snmp-server traps l2tun tunnel-down",
# "snmp-server traps l2vpn all",
# "snmp-server traps l2vpn vc-up",
# "snmp-server traps l2vpn vc-down",
# "snmp-server traps msdp peer-state-change",
# "snmp-server community test2 RO SDROwner IPv4 test IPv6 test1",
# "snmp-server community-map cm1 context c1 security-name s1 target-list t1",
# "snmp-server context c1",
# "snmp-server context c2",
# "snmp-server user u1 test2 v1 IPv4 test1 IPv6 test2",
# "snmp-server target list test2 vrf vrf2",
# "snmp-server target list test host 1.1.1.2",
# "snmp-server vrf vrf1",
# "host 1.1.1.1 traps test1"
#
# ],
# After state:
# ------------
# RP/0/RP0/CPU0:test2#show running-config snmp-server
# Mon Nov 29 12:49:29.521 UTC
# snmp-server vrf vrf1
# host 1.1.1.1 traps test1
# !
# snmp-server drop report acl IPv4 test1
# snmp-server drop unknown-user
# snmp-server ipv4 dscp af11
# snmp-server ipv6 precedence routine
# snmp-server user u1 test2 v1 IPv4 test1 IPv6 test2
# snmp-server community test2 RO SDROwner IPv4 test IPv6 test1
# snmp-server queue-length 2
# snmp-server trap-timeout 3
# snmp-server trap throttle-time 12
# snmp-server traps bfd
# snmp-server traps bgp cbgp2
# snmp-server traps copy-complete
# snmp-server traps hsrp
# snmp-server traps ipsla
# snmp-server traps msdp peer-state-change
# snmp-server traps ipsec tunnel stop
# snmp-server traps ipsec tunnel start
# snmp-server traps config
# snmp-server traps l2tun sessions
# snmp-server traps l2tun tunnel-up
# snmp-server traps l2tun tunnel-down
# snmp-server traps bulkstat collection
# snmp-server traps l2vpn all
# snmp-server traps l2vpn vc-up
# snmp-server traps l2vpn vc-down
# snmp-server traps bridgemib
# snmp-server traps addrpool low
# snmp-server traps addrpool high
# snmp-server traps cisco-entity-ext
# snmp-server chassis-id test2
# snmp-server contact t1
# snmp-server location test1
# snmp-server target list test host 1.1.1.2
# snmp-server target list test2 vrf vrf2
# snmp-server context c1
# snmp-server context c2
# snmp-server logging threshold oid-processing 1
# snmp-server logging threshold pdu-processing 1
# snmp-server mib bulkstat max-procmem-size 101
# snmp-server timeouts duplicate 0
# snmp-server timeouts inQdrop 0
# snmp-server packetsize 490
# snmp-server correlator buffer-size 1024
# snmp-server trap-source GigabitEthernet0/0/0/2
# snmp-server throttle-time 60
# snmp-server community-map cm1 context c1 security-name s1 target-list t1
# snmp-server inform retries 7
# snmp-server overload-control 4 6
# snmp-server ifmib internal cache max-duration 4
# snmp-server mroutemib send-all-vrf
# snmp-server notification-log-mib size 5
# snmp-server notification-log-mib GlobalSize 5
#
#
# Using state: deleted
# Before state:
# -------------
# RP/0/RP0/CPU0:test2#show running-config snmp-server
# Mon Nov 29 12:49:29.521 UTC
# snmp-server vrf vrf1
# host 1.1.1.1 traps test1
# !
# snmp-server drop report acl IPv4 test1
# snmp-server drop unknown-user
# snmp-server ipv4 dscp af11
# snmp-server ipv6 precedence routine
# snmp-server user u1 test2 v1 IPv4 test1 IPv6 test2
# snmp-server community test2 RO SDROwner IPv4 test IPv6 test1
# snmp-server queue-length 2
# snmp-server trap-timeout 3
# snmp-server trap throttle-time 12
# snmp-server traps bfd
# snmp-server traps bgp cbgp2
# snmp-server traps copy-complete
# snmp-server traps hsrp
# snmp-server traps ipsla
# snmp-server traps msdp peer-state-change
# snmp-server traps ipsec tunnel stop
# snmp-server traps ipsec tunnel start
# snmp-server traps config
# snmp-server traps l2tun sessions
# snmp-server traps l2tun tunnel-up
# snmp-server traps l2tun tunnel-down
# snmp-server traps bulkstat collection
# snmp-server traps l2vpn all
# snmp-server traps l2vpn vc-up
# snmp-server traps l2vpn vc-down
# snmp-server traps bridgemib
# snmp-server traps addrpool low
# snmp-server traps addrpool high
# snmp-server traps cisco-entity-ext
# snmp-server chassis-id test2
# snmp-server contact t1
# snmp-server location test1
# snmp-server target list test host 1.1.1.2
# snmp-server target list test2 vrf vrf2
# snmp-server context c1
# snmp-server context c2
# snmp-server logging threshold oid-processing 1
# snmp-server logging threshold pdu-processing 1
# snmp-server mib bulkstat max-procmem-size 101
# snmp-server timeouts duplicate 0
# snmp-server timeouts inQdrop 0
# snmp-server packetsize 490
# snmp-server correlator buffer-size 1024
# snmp-server trap-source GigabitEthernet0/0/0/2
# snmp-server throttle-time 60
# snmp-server community-map cm1 context c1 security-name s1 target-list t1
# snmp-server inform retries 7
# snmp-server overload-control 4 6
# snmp-server ifmib internal cache max-duration 4
# snmp-server mroutemib send-all-vrf
# snmp-server notification-log-mib size 5
# snmp-server notification-log-mib GlobalSize 5
# Deleted play:
# -------------
- name: Remove all existing configuration
cisco.iosxr.iosxr_snmp_server:
state: deleted
# Commands Fired:
# ---------------
# "commands": [
# "no snmp-server chassis-id test2",
# "no snmp-server correlator buffer-size 1024",
# "no snmp-server contact t1",
# "no snmp-server ipv4 dscp af11",
# "no snmp-server ipv6 precedence routine",
# "no snmp-server location test1",
# "no snmp-server logging threshold oid-processing 1",
# "no snmp-server logging threshold pdu-processing 1",
# "no snmp-server mib bulkstat max-procmem-size 101",
# "no snmp-server mroutemib send-all-vrf",
# "no snmp-server overload-control 4 6",
# "no snmp-server packetsize 490",
# "no snmp-server queue-length 2",
# "no snmp-server throttle-time 60",
# "no snmp-server trap-source GigabitEthernet0/0/0/2",
# "no snmp-server trap-timeout 3",
# "no snmp-server drop report acl IPv4 test1",
# "no snmp-server drop unknown-user",
# "no snmp-server ifmib internal cache max-duration 4",
# "no snmp-server inform retries 7",
# "no snmp-server notification-log-mib size 5",
# "no snmp-server notification-log-mib GlobalSize 5",
# "no snmp-server trap throttle-time 12",
# "no snmp-server timeouts inQdrop 0",
# "no snmp-server timeouts duplicate 0",
# "no snmp-server traps addrpool low",
# "no snmp-server traps addrpool high",
# "no snmp-server traps bfd",
# "no snmp-server traps bgp cbgp2",
# "no snmp-server traps bulkstat collection",
# "no snmp-server traps bridgemib",
# "no snmp-server traps copy-complete",
# "no snmp-server traps cisco-entity-ext",
# "no snmp-server traps config",
# "no snmp-server traps hsrp",
# "no snmp-server traps ipsla",
# "no snmp-server traps ipsec tunnel start",
# "no snmp-server traps ipsec tunnel stop",
# "no snmp-server traps l2tun sessions",
# "no snmp-server traps l2tun tunnel-up",
# "no snmp-server traps l2tun tunnel-down",
# "no snmp-server traps l2vpn all",
# "no snmp-server traps l2vpn vc-up",
# "no snmp-server traps l2vpn vc-down",
# "no snmp-server traps msdp peer-state-change",
# "no snmp-server community test2 RO SDROwner IPv4 test IPv6 test1",
# "no snmp-server community-map cm1 context c1 security-name s1 target-list t1",
# "no snmp-server context c1",
# "no snmp-server context c2",
# "no snmp-server user u1 test2 v1 IPv4 test1 IPv6 test2",
# "no snmp-server target list test host 1.1.1.2",
# "no snmp-server target list test2 vrf vrf2",
# "no snmp-server vrf vrf1"
# ],
# After state:
# ------------
# RP/0/0/CPU0:10#show running-config ntp
# --------------------- EMPTY -----------------
# Using state: overridden
# Before state:
# -------------
# RP/0/0/CPU0:10#show running-config snmp-server
# snmp-server vrf vrf1
# host 1.1.1.1 traps test1
# !
# snmp-server drop report acl IPv4 test1
# snmp-server drop unknown-user
# snmp-server ipv4 dscp af11
# snmp-server ipv6 precedence routine
# snmp-server user u1 test2 v1 IPv4 test1 IPv6 test2
# snmp-server community test2 RO SDROwner IPv4 test IPv6 test1
# snmp-server queue-length 2
# snmp-server trap-timeout 3
# snmp-server trap throttle-time 12
# snmp-server traps bfd
# snmp-server traps bgp cbgp2
# snmp-server traps copy-complete
# snmp-server traps hsrp
# snmp-server traps ipsla
# snmp-server traps msdp peer-state-change
# snmp-server traps ipsec tunnel stop
# snmp-server traps ipsec tunnel start
# snmp-server traps config
# snmp-server traps l2tun sessions
# snmp-server traps l2tun tunnel-up
# snmp-server traps l2tun tunnel-down
# snmp-server traps bulkstat collection
# snmp-server traps l2vpn all
# snmp-server traps l2vpn vc-up
# snmp-server traps l2vpn vc-down
# snmp-server traps bridgemib
# snmp-server traps addrpool low
# snmp-server traps addrpool high
# snmp-server traps cisco-entity-ext
# snmp-server chassis-id test2
# snmp-server contact t1
# snmp-server location test1
# snmp-server target list test host 1.1.1.2
# snmp-server target list test2 vrf vrf2
# snmp-server context c1
# snmp-server context c2
# snmp-server logging threshold oid-processing 1
# snmp-server logging threshold pdu-processing 1
# snmp-server mib bulkstat max-procmem-size 101
# snmp-server timeouts duplicate 0
# snmp-server timeouts inQdrop 0
# snmp-server packetsize 490
# snmp-server correlator buffer-size 1024
# snmp-server trap-source GigabitEthernet0/0/0/2
# snmp-server throttle-time 60
# snmp-server community-map cm1 context c1 security-name s1 target-list t1
# snmp-server inform retries 7
# snmp-server overload-control 4 6
# snmp-server ifmib internal cache max-duration 4
# snmp-server mroutemib send-all-vrf
# snmp-server notification-log-mib size 5
# snmp-server notification-log-mib GlobalSize 5
# Overridden play:
# ----------------
- name: Override Snmp-server configuration with provided configuration
cisco.iosxr.iosxr_snmp_server:
config:
timeouts:
duplicate: 0
inQdrop: 0
trap:
throttle_time: 13
targets:
- host: 1.1.1.2
name: test
ifmib:
internal_cache_max_duration: 5
inform:
retries: 7
chassis_id: test
packetsize: 491
queue_length: 2
throttle_time: 60
trap_source: GigabitEthernet0/0/0/2
trap_timeout: 3
context:
- c1
- c2
contact: t1
correlator:
buffer_size: 1025
communities:
- name: test1
ro: true
sdrowner: true
acl_v4: test
acl_v6: test1
community_maps:
- name: cm2
context: c1
target_list: t1
security_name: s1
drop:
report_IPv4: test2
unknown_user: true
ipv6:
precedence: routine
ipv4:
dscp: af11
location: test1
logging_threshold_oid_processing: 2
logging_threshold_pdu_processing: 2
mib_bulkstat_max_procmem_size: 101
mroutemib_send_all_vrf: true
overload_control:
overload_drop_time: 4
overload_throttle_rate: 6
notification_log_mib:
GlobalSize: 5
size: 5
traps:
hsrp: true
ipsla: true
ipsec:
start: true
stop: true
bridgemib: true
bulkstat_collection: true
cisco_entity_ext: true
config: true
copy_complete: true
l2vpn:
all: true
vc_down: true
vc_up: true
msdp_peer_state_change: true
state: overridden
# Commands Fired:
# ---------------
# "commands": [
# "no snmp-server traps addrpool low",
# "no snmp-server traps addrpool high",
# "no snmp-server traps bfd",
# "no snmp-server traps bgp cbgp2",
# "no snmp-server traps l2tun sessions",
# "no snmp-server traps l2tun tunnel-up",
# "no snmp-server traps l2tun tunnel-down",
# "no snmp-server community test2 RO SDROwner IPv4 test IPv6 test1",
# "no snmp-server community-map cm1 context c1 security-name s1 target-list t1",
# "no snmp-server user u1 test2 v1 IPv4 test1 IPv6 test2",
# "no snmp-server vrf vrf1",
# "snmp-server chassis-id test",
# "snmp-server correlator buffer-size 1025",
# "snmp-server logging threshold oid-processing 2",
# "snmp-server logging threshold pdu-processing 2",
# "snmp-server packetsize 491",
# "snmp-server drop report acl IPv4 test2",
# "snmp-server ifmib internal cache max-duration 5",
# "snmp-server trap throttle-time 13",
# "snmp-server community test1 RO SDROwner IPv4 test IPv6 test1",
# "snmp-server community-map cm2 context c1 security-name s1 target-list t1"
# ],
# After state:
# ------------
# RP/0/RP0/CPU0:test2#show running-config snmp-server
# Mon Nov 29 12:57:34.182 UTC
# snmp-server drop report acl IPv4 test2
# snmp-server drop unknown-user
# snmp-server ipv4 dscp af11
# snmp-server ipv6 precedence routine
# snmp-server community test1 RO SDROwner IPv4 test IPv6 test1
# snmp-server queue-length 2
# snmp-server trap-timeout 3
# snmp-server trap throttle-time 13
# snmp-server traps copy-complete
# snmp-server traps hsrp
# snmp-server traps ipsla
# snmp-server traps msdp peer-state-change
# snmp-server traps ipsec tunnel stop
# snmp-server traps ipsec tunnel start
# snmp-server traps config
# snmp-server traps bulkstat collection
# snmp-server traps l2vpn all
# snmp-server traps l2vpn vc-up
# snmp-server traps l2vpn vc-down
# snmp-server traps bridgemib
# snmp-server traps cisco-entity-ext
# snmp-server chassis-id test
# snmp-server contact t1
# snmp-server location test1
# snmp-server target list test host 1.1.1.2
# snmp-server target list test2 vrf vrf2
# snmp-server context c1
# snmp-server context c2
# snmp-server logging threshold oid-processing 2
# snmp-server logging threshold pdu-processing 2
# snmp-server mib bulkstat max-procmem-size 101
# snmp-server timeouts duplicate 0
# snmp-server timeouts inQdrop 0
# snmp-server packetsize 491
# snmp-server correlator buffer-size 1025
# snmp-server trap-source GigabitEthernet0/0/0/2
# snmp-server throttle-time 60
# snmp-server community-map cm2 context c1 security-name s1 target-list t1
# snmp-server inform retries 7
# snmp-server overload-control 4 6
# snmp-server ifmib internal cache max-duration 5
# snmp-server mroutemib send-all-vrf
# snmp-server notification-log-mib size 5
# snmp-server notification-log-mib GlobalSize 5
#
# Using state: replaced
# Before state:
# -------------
# RP/0/0/CPU0:10#show running-config snmp-server
# snmp-server vrf vrf1
# host 1.1.1.1 traps test1
# !
# snmp-server drop report acl IPv4 test1
# snmp-server drop unknown-user
# snmp-server ipv4 dscp af11
# snmp-server ipv6 precedence routine
# snmp-server user u1 test2 v1 IPv4 test1 IPv6 test2
# snmp-server community test2 RO SDROwner IPv4 test IPv6 test1
# snmp-server queue-length 2
# snmp-server trap-timeout 3
# snmp-server trap throttle-time 12
# snmp-server traps bfd
# snmp-server traps bgp cbgp2
# snmp-server traps copy-complete
# snmp-server traps hsrp
# snmp-server traps ipsla
# snmp-server traps msdp peer-state-change
# snmp-server traps ipsec tunnel stop
# snmp-server traps ipsec tunnel start
# snmp-server traps config
# snmp-server traps l2tun sessions
# snmp-server traps l2tun tunnel-up
# snmp-server traps l2tun tunnel-down
# snmp-server traps bulkstat collection
# snmp-server traps l2vpn all
# snmp-server traps l2vpn vc-up
# snmp-server traps l2vpn vc-down
# snmp-server traps bridgemib
# snmp-server traps addrpool low
# snmp-server traps addrpool high
# snmp-server traps cisco-entity-ext
# snmp-server chassis-id test2
# snmp-server contact t1
# snmp-server location test1
# snmp-server target list test host 1.1.1.2
# snmp-server target list test2 vrf vrf2
# snmp-server context c1
# snmp-server context c2
# snmp-server logging threshold oid-processing 1
# snmp-server logging threshold pdu-processing 1
# snmp-server mib bulkstat max-procmem-size 101
# snmp-server timeouts duplicate 0
# snmp-server timeouts inQdrop 0
# snmp-server packetsize 490
# snmp-server correlator buffer-size 1024
# snmp-server trap-source GigabitEthernet0/0/0/2
# snmp-server throttle-time 60
# snmp-server community-map cm1 context c1 security-name s1 target-list t1
# snmp-server inform retries 7
# snmp-server overload-control 4 6
# snmp-server ifmib internal cache max-duration 4
# snmp-server mroutemib send-all-vrf
# snmp-server notification-log-mib size 5
# snmp-server notification-log-mib GlobalSize 5
#
#
# Replaced play:
# ----------------
- name: Replace Snmp-server configuration with provided configuration
cisco.iosxr.iosxr_snmp_server:
state: replaced
config:
timeouts:
duplicate: 0
inQdrop: 0
trap:
throttle_time: 13
targets:
- host: 1.1.1.2
name: test
ifmib:
internal_cache_max_duration: 5
inform:
retries: 7
chassis_id: test
packetsize: 491
queue_length: 2
throttle_time: 60
trap_source: GigabitEthernet0/0/0/2
trap_timeout: 3
context:
- c1
- c2
contact: t1
correlator:
buffer_size: 1025
communities:
- name: test1
ro: true
sdrowner: true
acl_v4: test
acl_v6: test1
community_maps:
- name: cm2
context: c1
target_list: t1
security_name: s1
drop:
report_IPv4: test2
unknown_user: true
ipv6:
precedence: routine
ipv4:
dscp: af11
location: test1
logging_threshold_oid_processing: 2
logging_threshold_pdu_processing: 2
mib_bulkstat_max_procmem_size: 101
mroutemib_send_all_vrf: true
overload_control:
overload_drop_time: 4
overload_throttle_rate: 6
notification_log_mib:
GlobalSize: 5
size: 5
traps:
hsrp: true
ipsla: true
ipsec:
start: true
stop: true
bridgemib: true
bulkstat_collection: true
cisco_entity_ext: true
config: true
copy_complete: true
l2vpn:
all: true
vc_down: true
vc_up: true
msdp_peer_state_change: true
#
# Commands Fired:
# ---------------
# "commands": [
# "no snmp-server traps addrpool low",
# "no snmp-server traps addrpool high",
# "no snmp-server traps bfd",
# "no snmp-server traps bgp cbgp2",
# "no snmp-server traps l2tun sessions",
# "no snmp-server traps l2tun tunnel-up",
# "no snmp-server traps l2tun tunnel-down",
# "no snmp-server community test2 RO SDROwner IPv4 test IPv6 test1",
# "no snmp-server community-map cm1 context c1 security-name s1 target-list t1",
# "no snmp-server user u1 test2 v1 IPv4 test1 IPv6 test2",
# "no snmp-server vrf vrf1",
# "snmp-server chassis-id test",
# "snmp-server correlator buffer-size 1025",
# "snmp-server logging threshold oid-processing 2",
# "snmp-server logging threshold pdu-processing 2",
# "snmp-server packetsize 491",
# "snmp-server drop report acl IPv4 test2",
# "snmp-server ifmib internal cache max-duration 5",
# "snmp-server trap throttle-time 13",
# "snmp-server community test1 RO SDROwner IPv4 test IPv6 test1",
# "snmp-server community-map cm2 context c1 security-name s1 target-list t1"
# ],
# After state:
# ------------
# RP/0/RP0/CPU0:ios#show running-config snmp-server
# Mon Sep 13 10:38:22.690 UTC
# RP/0/0/CPU0:10#show running-config snmp-server
# snmp-server vrf vrf1
# host 1.1.1.1 traps test1
# !
# snmp-server drop report acl IPv4 test1
# snmp-server drop unknown-user
# snmp-server ipv4 dscp af11
# snmp-server ipv6 precedence routine
# snmp-server user u1 test2 v1 IPv4 test1 IPv6 test2
# snmp-server community test2 RO SDROwner IPv4 test IPv6 test1
# snmp-server queue-length 2
# snmp-server trap-timeout 3
# snmp-server trap throttle-time 12
# snmp-server traps bfd
# snmp-server traps bgp cbgp2
# snmp-server traps copy-complete
# snmp-server traps hsrp
# snmp-server traps ipsla
# snmp-server traps msdp peer-state-change
# snmp-server traps ipsec tunnel stop
# snmp-server traps ipsec tunnel start
# snmp-server traps config
# snmp-server traps l2tun sessions
# snmp-server traps l2tun tunnel-up
# snmp-server traps l2tun tunnel-down
# snmp-server traps bulkstat collection
# snmp-server traps l2vpn all
# snmp-server traps l2vpn vc-up
# snmp-server traps l2vpn vc-down
# snmp-server traps bridgemib
# snmp-server traps addrpool low
# snmp-server traps addrpool high
# snmp-server traps cisco-entity-ext
# snmp-server chassis-id test2
# snmp-server contact t1
# snmp-server location test1
# snmp-server target list test host 1.1.1.2
# snmp-server target list test2 vrf vrf2
# snmp-server context c1
# snmp-server context c2
# snmp-server logging threshold oid-processing 1
# snmp-server logging threshold pdu-processing 1
# snmp-server mib bulkstat max-procmem-size 101
# snmp-server timeouts duplicate 0
# snmp-server timeouts inQdrop 0
# snmp-server packetsize 490
# snmp-server correlator buffer-size 1024
# snmp-server trap-source GigabitEthernet0/0/0/2
# snmp-server throttle-time 60
# snmp-server community-map cm1 context c1 security-name s1 target-list t1
# snmp-server inform retries 7
# snmp-server overload-control 4 6
# snmp-server ifmib internal cache max-duration 4
# snmp-server mroutemib send-all-vrf
# snmp-server notification-log-mib size 5
# snmp-server notification-log-mib GlobalSize 5
#
#
# Using state: gathered
# Before state:
# -------------
# RP/0/RP0/CPU0:test2#show running-config snmp-server
# Mon Nov 29 12:49:29.521 UTC
# snmp-server vrf vrf1
# host 1.1.1.1 traps test1
# !
# snmp-server drop report acl IPv4 test1
# snmp-server drop unknown-user
# snmp-server ipv4 dscp af11
# snmp-server ipv6 precedence routine
# snmp-server user u1 test2 v1 IPv4 test1 IPv6 test2
# snmp-server community test2 RO SDROwner IPv4 test IPv6 test1
# snmp-server queue-length 2
# snmp-server trap-timeout 3
# snmp-server trap throttle-time 12
# snmp-server traps bfd
# snmp-server traps bgp cbgp2
# snmp-server traps copy-complete
# snmp-server traps hsrp
# snmp-server traps ipsla
# snmp-server traps msdp peer-state-change
# snmp-server traps ipsec tunnel stop
# snmp-server traps ipsec tunnel start
# snmp-server traps config
# snmp-server traps l2tun sessions
# snmp-server traps l2tun tunnel-up
# snmp-server traps l2tun tunnel-down
# snmp-server traps bulkstat collection
# snmp-server traps l2vpn all
# snmp-server traps l2vpn vc-up
# snmp-server traps l2vpn vc-down
# snmp-server traps bridgemib
# snmp-server traps addrpool low
# snmp-server traps addrpool high
# snmp-server traps cisco-entity-ext
# snmp-server chassis-id test2
# snmp-server contact t1
# snmp-server location test1
# snmp-server target list test host 1.1.1.2
# snmp-server target list test2 vrf vrf2
# snmp-server context c1
# snmp-server context c2
# snmp-server logging threshold oid-processing 1
# snmp-server logging threshold pdu-processing 1
# snmp-server mib bulkstat max-procmem-size 101
# snmp-server timeouts duplicate 0
# snmp-server timeouts inQdrop 0
# snmp-server packetsize 490
# snmp-server correlator buffer-size 1024
# snmp-server trap-source GigabitEthernet0/0/0/2
# snmp-server throttle-time 60
# snmp-server community-map cm1 context c1 security-name s1 target-list t1
# snmp-server inform retries 7
# snmp-server overload-control 4 6
# snmp-server ifmib internal cache max-duration 4
# snmp-server mroutemib send-all-vrf
# snmp-server notification-log-mib size 5
# snmp-server notification-log-mib GlobalSize 5
# Gathered play:
# --------------
- name: Gather listed snmp server
cisco.iosxr.iosxr_snmp_server:
state: gathered
# Module Execution Result:
# ------------------------
# "gathered": {
# "chassis_id": "test2",
# "communities": [
# {
# "acl_v4": "test",
# "acl_v6": "test1",
# "name": "test2",
# "ro": true,
# "sdrowner": true
# }
# ],
# "community_maps": [
# {
# "context": "c1",
# "name": "cm1",
# "security_name": "s1",
# "target_list": "t1"
# }
# ],
# "contact": "t1",
# "context": [
# "c1",
# "c2"
# ],
# "correlator": {
# "buffer_size": 1024
# },
# "drop": {
# "report_IPv4": "test1",
# "unknown_user": true
# },
# "ifmib": {
# "internal_cache_max_duration": 4
# },
# "inform": {
# "retries": 7
# },
# "ipv4": {
# "dscp": "af11"
# },
# "ipv6": {
# "precedence": "routine"
# },
# "location": "test1",
# "logging_threshold_oid_processing": 1,
# "logging_threshold_pdu_processing": 1,
# "mib_bulkstat_max_procmem_size": 101,
# "mroutemib_send_all_vrf": true,
# "notification_log_mib": {
# "GlobalSize": 5,
# "size": 5
# },
# "overload_control": {
# "overload_drop_time": 4,
# "overload_throttle_rate": 6
# },
# "packetsize": 490,
# "queue_length": 2,
# "targets": [
# {
# "host": "1.1.1.2",
# "name": "test"
# },
# {
# "name": "test2",
# "vrf": "vrf2"
# }
# ],
# "throttle_time": 60,
# "timeouts": {
# "duplicate": 0,
# "inQdrop": 0
# },
# "trap": {
# "throttle_time": 12
# },
# "trap_source": "GigabitEthernet0/0/0/2",
# "trap_timeout": 3,
# "traps": {
# "addrpool": {
# "high": true,
# "low": true
# },
# "bfd": true,
# "bgp": {
# "cbgp2": true
# },
# "bridgemib": true,
# "bulkstat_collection": true,
# "cisco_entity_ext": true,
# "config": true,
# "copy_complete": true,
# "hsrp": true,
# "ipsec": {
# "start": true,
# "stop": true
# },
# "ipsla": true,
# "l2tun": {
# "sessions": true,
# "tunnel_down": true,
# "tunnel_up": true
# },
# "l2vpn": {
# "all": true,
# "vc_down": true,
# "vc_up": true
# },
# "msdp_peer_state_change": true
# },
# "users": [
# {
# "Ipv4_acl": "test1",
# "Ipv6_acl": "test2",
# "group": "test2",
# "user": "u1",
# "version": "v1"
# }
# ],
# "vrfs": [
# {
# "hosts": [
# {
# "community": "test1",
# "host": "1.1.1.1",
# "traps": true
# }
# ],
# "vrf": "vrf1"
# }
# ]
# }
#
#
# Using state: rendered
# Rendered play:
# --------------
- name: Render platform specific configuration lines with state rendered (without connecting to the device)
cisco.iosxr.iosxr_snmp_server:
state: rendered
config:
vrfs:
- hosts:
- community: test1
host: 1.1.1.1
traps: true
vrf: vrf1
users:
- Ipv4_acl: test1
Ipv6_acl: test2
group: test2
user: u1
version: v1
timeouts:
duplicate: 0
inQdrop: 0
trap:
throttle_time: 12
targets:
- host: 1.1.1.2
name: test
ifmib:
internal_cache_max_duration: 4
inform:
retries: 7
chassis_id: test2
packetsize: 490
queue_length: 2
throttle_time: 60
trap_source: GigabitEthernet0/0/0/2
trap_timeout: 3
context:
- c1
- c2
contact: t1
correlator:
buffer_size: 1024
communities:
- name: test2
ro: true
sdrowner: true
acl_v4: test
acl_v6: test1
community_maps:
- name: cm1
context: c1
target_list: t1
security_name: s1
drop:
report_IPv4: test1
unknown_user: true
ipv6:
precedence: routine
ipv4:
dscp: af11
location: test1
logging_threshold_oid_processing: 1
logging_threshold_pdu_processing: 1
mib_bulkstat_max_procmem_size: 101
mroutemib_send_all_vrf: true
overload_control:
overload_drop_time: 4
overload_throttle_rate: 6
notification_log_mib:
GlobalSize: 5
size: 5
traps:
hsrp: true
ipsla: true
ipsec:
start: true
stop: true
bridgemib: true
bulkstat_collection: true
cisco_entity_ext: true
config: true
copy_complete: true
addrpool:
high: true
low: true
bfd: true
bgp:
cbgp2: true
l2tun:
sessions: true
tunnel_down: true
tunnel_up: true
l2vpn:
all: true
vc_down: true
vc_up: true
msdp_peer_state_change: true
register: result
# Module Execution Result:
# ------------------------
# "rendered": [
# "snmp-server chassis-id test2",
# "snmp-server correlator buffer-size 1024",
# "snmp-server contact t1",
# "snmp-server ipv4 dscp af11",
# "snmp-server ipv6 precedence routine",
# "snmp-server location test1",
# "snmp-server logging threshold oid-processing 1",
# "snmp-server logging threshold pdu-processing 1",
# "snmp-server mib bulkstat max-procmem-size 101",
# "snmp-server mroutemib send-all-vrf",
# "snmp-server overload-control 4 6",
# "snmp-server packetsize 490",
# "snmp-server queue-length 2",
# "snmp-server throttle-time 60",
# "snmp-server trap-source GigabitEthernet0/0/0/2",
# "snmp-server trap-timeout 3",
# "snmp-server drop report acl IPv4 test1",
# "snmp-server drop unknown-user",
# "snmp-server ifmib internal cache max-duration 4",
# "snmp-server inform retries 7",
# "snmp-server notification-log-mib size 5",
# "snmp-server notification-log-mib GlobalSize 5",
# "snmp-server trap throttle-time 12",
# "snmp-server timeouts inQdrop 0",
# "snmp-server timeouts duplicate 0",
# "snmp-server traps addrpool low",
# "snmp-server traps addrpool high",
# "snmp-server traps bfd",
# "snmp-server traps bgp cbgp2",
# "snmp-server traps bulkstat collection",
# "snmp-server traps bridgemib",
# "snmp-server traps copy-complete",
# "snmp-server traps cisco-entity-ext",
# "snmp-server traps config",
# "snmp-server traps hsrp",
# "snmp-server traps ipsla",
# "snmp-server traps ipsec tunnel start",
# "snmp-server traps ipsec tunnel stop",
# "snmp-server traps l2tun sessions",
# "snmp-server traps l2tun tunnel-up",
# "snmp-server traps l2tun tunnel-down",
# "snmp-server traps l2vpn all",
# "snmp-server traps l2vpn vc-up",
# "snmp-server traps l2vpn vc-down",
# "snmp-server traps msdp peer-state-change",
# "snmp-server community test2 RO SDROwner IPv4 test IPv6 test1",
# "snmp-server community-map cm1 context c1 security-name s1 target-list t1",
# "snmp-server context c1",
# "snmp-server context c2",
# "snmp-server user u1 test2 v1 IPv4 test1 IPv6 test2",
# "snmp-server target list test2 vrf vrf2",
# "snmp-server target list test host 1.1.1.2",
# "snmp-server vrf vrf1",
# "host 1.1.1.1 traps test1"
# ],
# Using state: parsed
# File: parsed.cfg
# ----------------
# snmp-server vrf vrf1
# host 1.1.1.1 traps test1
# !
# snmp-server drop report acl IPv4 test1
# snmp-server drop unknown-user
# snmp-server ipv4 dscp af11
# snmp-server ipv6 precedence routine
# snmp-server user u1 test2 v1 IPv4 test1 IPv6 test2
# snmp-server community test2 RO SDROwner IPv4 test IPv6 test1
# snmp-server queue-length 2
# snmp-server trap-timeout 3
# snmp-server trap throttle-time 12
# snmp-server traps bfd
# snmp-server traps bgp cbgp2
# snmp-server traps copy-complete
# snmp-server traps hsrp
# snmp-server traps ipsla
# snmp-server traps msdp peer-state-change
# snmp-server traps ipsec tunnel stop
# snmp-server traps ipsec tunnel start
# snmp-server traps config
# snmp-server traps l2tun sessions
# snmp-server traps l2tun tunnel-up
# snmp-server traps l2tun tunnel-down
# snmp-server traps bulkstat collection
# snmp-server traps l2vpn all
# snmp-server traps l2vpn vc-up
# snmp-server traps l2vpn vc-down
# snmp-server traps bridgemib
# snmp-server traps addrpool low
# snmp-server traps addrpool high
# snmp-server traps cisco-entity-ext
# snmp-server chassis-id test2
# snmp-server contact t1
# snmp-server location test1
# snmp-server target list test host 1.1.1.2
# snmp-server target list test2 vrf vrf2
# snmp-server context c1
# snmp-server context c2
# snmp-server logging threshold oid-processing 1
# snmp-server logging threshold pdu-processing 1
# snmp-server mib bulkstat max-procmem-size 101
# snmp-server timeouts duplicate 0
# snmp-server timeouts inQdrop 0
# snmp-server packetsize 490
# snmp-server correlator buffer-size 1024
# snmp-server trap-source GigabitEthernet0/0/0/2
# snmp-server throttle-time 60
# snmp-server community-map cm1 context c1 security-name s1 target-list t1
# snmp-server inform retries 7
# snmp-server overload-control 4 6
# snmp-server ifmib internal cache max-duration 4
# snmp-server mroutemib send-all-vrf
# snmp-server notification-log-mib size 5
# snmp-server notification-log-mib GlobalSize 5
# ------------
- name: Parse the provided configuration with the existing running configuration
cisco.iosxr.iosxr_snmp_server:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
# "parsed":{
# "chassis_id": "test2",
# "communities": [
# {
# "acl_v4": "test",
# "acl_v6": "test1",
# "name": "test2",
# "ro": true,
# "sdrowner": true
# }
# ],
# "community_maps": [
# {
# "context": "c1",
# "name": "cm1",
# "security_name": "s1",
# "target_list": "t1"
# }
# ],
# "contact": "t1",
# "context": [
# "c1",
# "c2"
# ],
# "correlator": {
# "buffer_size": 1024
# },
# "drop": {
# "report_IPv4": "test1",
# "unknown_user": true
# },
# "ifmib": {
# "internal_cache_max_duration": 4
# },
# "inform": {
# "retries": 7
# },
# "ipv4": {
# "dscp": "af11"
# },
# "ipv6": {
# "precedence": "routine"
# },
# "location": "test1",
# "logging_threshold_oid_processing": 1,
# "logging_threshold_pdu_processing": 1,
# "mib_bulkstat_max_procmem_size": 101,
# "mroutemib_send_all_vrf": true,
# "notification_log_mib": {
# "GlobalSize": 5,
# "size": 5
# },
# "overload_control": {
# "overload_drop_time": 4,
# "overload_throttle_rate": 6
# },
# "packetsize": 490,
# "queue_length": 2,
# "targets": [
# {
# "host": "1.1.1.2",
# "name": "test"
# },
# {
# "name": "test2",
# "vrf": "vrf2"
# }
# ],
# "throttle_time": 60,
# "timeouts": {
# "duplicate": 0,
# "inQdrop": 0
# },
# "trap": {
# "throttle_time": 12
# },
# "trap_source": "GigabitEthernet0/0/0/2",
# "trap_timeout": 3,
# "traps": {
# "addrpool": {
# "high": true,
# "low": true
# },
# "bfd": true,
# "bgp": {
# "cbgp2": true
# },
# "bridgemib": true,
# "bulkstat_collection": true,
# "cisco_entity_ext": true,
# "config": true,
# "copy_complete": true,
# "hsrp": true,
# "ipsec": {
# "start": true,
# "stop": true
# },
# "ipsla": true,
# "l2tun": {
# "sessions": true,
# "tunnel_down": true,
# "tunnel_up": true
# },
# "l2vpn": {
# "all": true,
# "vc_down": true,
# "vc_up": true
# },
# "msdp_peer_state_change": true
# },
# "users": [
# {
# "Ipv4_acl": "test1",
# "Ipv6_acl": "test2",
# "group": "test2",
# "user": "u1",
# "version": "v1"
# }
# ],
# "vrfs": [
# {
# "hosts": [
# {
# "community": "test1",
# "host": "1.1.1.1",
# "traps": true
# }
# ],
# "vrf": "vrf1"
# }
# ]
# }
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The resulting configuration after module execution. Returned: when changed Sample: |
|
The configuration prior to the module execution. Returned: when state is Sample: |
|
The set of commands pushed to the remote device. Returned: when state is Sample: |
|
Facts about the network resource gathered from the remote device as structured data. Returned: when state is Sample: |
|
The device native config provided in running_config option parsed into structured data as per module argspec. Returned: when state is Sample: |
|
The provided configuration in the task rendered in device-native format (offline). Returned: when state is Sample: |