.. _cisco.ios.ios_snmp_server_module: ************************* cisco.ios.ios_snmp_server ************************* **Resource module to configure snmp server.** Version added: 2.6.0 .. contents:: :local: :depth: 1 Synopsis -------- - This module provides declarative management of SNMP server on Cisco IOS devices. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
config
dictionary
A dictionary of SNMP server configuration
accounting
dictionary
SNMP Accounting parameters
command
string
For SNMP set commands
cache
integer
Enable SNMP cache and MIB expiry interval
chassis_id
string
String to uniquely identify this chassis (Hexadecimal)
communities
list / elements=dictionary
Community name configuration.
acl_v4
string
standard access-list name
acl_v6
string
IPv6 access list name
name
string
Community name (default RO)
ro
boolean
    Choices:
  • no
  • yes
Only reads are permitted
rw
boolean
    Choices:
  • no
  • yes
Read-write access
view
string
MIB view name
contact
string
Text for mib object sysContact
context
list / elements=string
Create/Delete a context apart from default
drop
dictionary
Silently drop SNMP packets
unknown_user
boolean
    Choices:
  • no
  • yes
Silently drop unknown v3 user packets
vrf_traffic
boolean
    Choices:
  • no
  • yes
Silently drop SNMP packets that come on VRF interfaces
engine_id
list / elements=dictionary
Configure a local or remote SNMPv3 engineID
id
string
engine ID octet string
local
boolean
    Choices:
  • no
  • yes
Local SNMP agent
remote
dictionary
Remote SNMP agent
host
string
Hostname or IP address of remote SNMP notification host
udp_port
integer
The remote SNMP notification host's UDP port number.
vrf
string
The remote notification host's VPN routing instance
file_transfer
dictionary
File transfer related commands
access_group
string
Access control for file transfers
protocol
list / elements=string
Access control protocol for file transfers
groups
list / elements=dictionary
Define a User Security Model group
acl_v4
string
specify an access-list associated with this group
acl_v6
string
specify an access-list associated with this group
context
string
Specify a context to associate with the group
group
string
SNMP group for the user
match
string
    Choices:
  • exact
  • prefix
Specify a context name match criteria
notify
string
View to restrict notifications
read
string
View to restrict read access
version
string
    Choices:
  • v1
  • v3
  • v2c
snmp security group version
version_option
string
    Choices:
  • auth
  • noauth
  • priv
community name to the host.
write
string
View to restrict write access
hosts
list / elements=dictionary
Specify hosts to receive SNMP notifications
community_string
string
SNMPv1/v2c community string or SNMPv3 user name
host
string
Hostname or IP address of SNMP notification host.
informs
boolean
    Choices:
  • no
  • yes
Use SNMP inform messages.
traps
list / elements=string
Use SNMP trap messages
version
string
    Choices:
  • 1
  • 2c
  • 3
Notification message SNMP version.
version_option
string
    Choices:
  • auth
  • noauth
  • priv
community name to the host.
vrf
string
Specify the VRF in which the host is configured
if_index
boolean
    Choices:
  • no
  • yes
Enable ifindex persistence
inform
dictionary
Configure SNMP Informs options
pending
integer
Set number of unacked informs to hold
retries
integer
Set retry count for informs
timeout
integer
Set timeout for informs
ip
dictionary
IP ToS configuration for SNMP traffic
dscp
integer
IP DSCP value for SNMP traffic
precedence
integer
IP Precedence value for SNMP traffic
location
string
Text for mib object sysLocation
manager
integer
Modify SNMP manager parameters
packet_size
integer
Largest SNMP packet size
password_policy
list / elements=dictionary
SNMP v3 users password policy
change
integer
Number of Character changes b/w old and new password
digits
integer
Number of digits
lower_case
integer
Number of lower-case characters
max_len
integer
Maximum password length
min_len
integer
Minimum password length
policy_name
string
Name of the policy
special_char
integer
Number of special case character
upper_case
integer
Number of upper-case characters
username
string
Name of the user
queue_length
integer
Message queue length for each TRAP host
source_interface
string
Source interface to be used for sending out SNMP notifications.
system_shutdown
boolean
    Choices:
  • no
  • yes
Enable use of the SNMP reload command
trap_source
string
Assign an interface for the source address of all traps
trap_timeout
integer
Set timeout for TRAP message retransmissions
traps
dictionary
Enable SNMP Traps
aaa_server
boolean
    Choices:
  • no
  • yes
Enable SNMP AAA Server traps
auth_framework
dictionary
Enable SNMP CISCO-AUTH-FRAMEWORK-MIB traps
enable
boolean
    Choices:
  • no
  • yes
Enable/disable auth framework
sec_violation
boolean
    Choices:
  • no
  • yes
Mode sec_violation
bfd
dictionary
Allow SNMP BFD traps
enable
boolean
    Choices:
  • no
  • yes
Enable/disable bfd
session_down
boolean
    Choices:
  • no
  • yes
Enable BFD session down traps
session_up
boolean
    Choices:
  • no
  • yes
Enable BFD session up traps
bgp
dictionary
Allow bgp traps
cbgp2
boolean
    Choices:
  • no
  • yes
Enable BGP MIBv2 traps
enable
boolean
    Choices:
  • no
  • yes
Enable/disable bgp traps
state_changes
dictionary
Traps for FSM state changes
all
boolean
    Choices:
  • no
  • yes
CISCO specific trap for all fsm state changes
backward_trans
boolean
    Choices:
  • no
  • yes
CISCO specific trap for backward transition
enable
boolean
    Choices:
  • no
  • yes
Enable/disable bgp state_changes traps
limited
boolean
    Choices:
  • no
  • yes
Trap for standard backward transition and established
threshold
dictionary
Mode threshold
prefix
boolean
    Choices:
  • no
  • yes
Enable/disable bgp threshold traps
bridge
dictionary
Allow bridge related traps
enable
boolean
    Choices:
  • no
  • yes
Enable/disable bridge traps
newroot
boolean
    Choices:
  • no
  • yes
Enable SNMP STP Bridge MIB newroot traps
topologychange
boolean
    Choices:
  • no
  • yes
Enable SNMP STP Bridge MIB topologychange traps
bulkstat
dictionary
Allow Data-Collection-MIB Collection notifications
collection
boolean
    Choices:
  • no
  • yes
Enable Data-Collection-MIB Collection notifications
enable
boolean
    Choices:
  • no
  • yes
Enable Data-Collection-MIB Collection and Transfert notifications
transfer
boolean
    Choices:
  • no
  • yes
Enable Data-Collection-MIB Transfer notifications
call_home
dictionary
SNMP CISCO-CALLHOME-MIB traps
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP CISCO-CALLHOME-MIB traps
message_send_fail
boolean
    Choices:
  • no
  • yes
Enable SNMP ccmSmtpMsgSendFailNotif notification
server_fail
boolean
    Choices:
  • no
  • yes
Enable SNMP ccmSmtpServerFailNotif notification
casa
boolean
    Choices:
  • no
  • yes
Enable SNMP config casa traps
cef
dictionary
Allow cef related traps
enable
boolean
    Choices:
  • no
  • yes
Enable/disable cef traps
inconsistency
boolean
    Choices:
  • no
  • yes
Enable SNMP CEF Inconsistency traps
peer_fib_state_change
boolean
    Choices:
  • no
  • yes
Enable SNMP CEF Peer FIB State change traps
peer_state_change
boolean
    Choices:
  • no
  • yes
Enable SNMP CEF Peer state change traps
resource_failure
boolean
    Choices:
  • no
  • yes
Enable SNMP CEF Resource Failure traps
cnpd
boolean
    Choices:
  • no
  • yes
Enable SNMP cnpd traps
config
boolean
    Choices:
  • no
  • yes
Enable SNMP config traps
config_copy
boolean
    Choices:
  • no
  • yes
Enable SNMP config copy traps
config_ctid
boolean
    Choices:
  • no
  • yes
Enable SNMP config ctid traps
cpu
dictionary
Allow CPU related traps
enable
boolean
    Choices:
  • no
  • yes
Enable/disable cpu traps
threshold
boolean
    Choices:
  • no
  • yes
Mode threshold
dhcp
boolean
    Choices:
  • no
  • yes
Enable SNMP dhcp traps
dlsw
dictionary
Allow dlsw related traps
circuit
boolean
    Choices:
  • no
  • yes
Enable SNMP dlsw circuit traps
enable
boolean
    Choices:
  • no
  • yes
Enable/disable cef traps
tconn
boolean
    Choices:
  • no
  • yes
Enable SNMP dlsw peer transport connection traps
eigrp
boolean
    Choices:
  • no
  • yes
Enable SNMP eigrp traps
energywise
boolean
    Choices:
  • no
  • yes
Enable SNMP energywise traps
entity
boolean
    Choices:
  • no
  • yes
Enable SNMP entity traps
entity_diag
dictionary
Allow SNMP CISCO-ENTITY-DIAG-MIB traps
boot_up_fail
boolean
    Choices:
  • no
  • yes
Enable SNMP ceDiagBootUpFailedNotif traps
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP CISCO-ENTITY-DIAG-MIB traps
hm_test_recover
boolean
    Choices:
  • no
  • yes
Enable SNMP ceDiagHMTestRecoverNotif traps
hm_thresh_reached
boolean
    Choices:
  • no
  • yes
Enable SNMP ceDiagHMThresholdReachedNotif traps
scheduled_test_fail
boolean
    Choices:
  • no
  • yes
Enable SNMP ceDiagScheduledTestFailedNotif traps
entity_perf
dictionary
Allow SNMP CISCO-ENTITY-PERFORMANCE-MIB traps
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP CISCO-ENTITY-PERFORMANCE-MIB traps
throughput_notif
boolean
    Choices:
  • no
  • yes
Enable ENTITY PERFORMANCE MIB throughput traps
entity_state
boolean
    Choices:
  • no
  • yes
Enable SNMP ENTITY-STATE-MIB traps
envmon
dictionary
Enable SNMP environmental monitor traps
enable
boolean
    Choices:
  • no
  • yes
Enable/disable envmon traps
fan
dictionary
Enable SNMP envmon fan traps
This option is DEPRECATED and is replaced with fan_enable which accepts bool as input
This attribute will be removed after 2024-09-01
enable
boolean
    Choices:
  • no
  • yes
Enable/disable fan traps
shutdown
boolean
    Choices:
  • no
  • yes
Enable SNMP environmental monitor shutdown traps
status
boolean
    Choices:
  • no
  • yes
Enable SNMP environmental status change traps
supply
boolean
    Choices:
  • no
  • yes
Enable SNMP environmental monitor supply traps
temperature
boolean
    Choices:
  • no
  • yes
Enable SNMP environmental monitor temperature traps
fan_enable
boolean
    Choices:
  • no
  • yes
Enable SNMP envmon fan traps
shutdown
boolean
    Choices:
  • no
  • yes
Enable SNMP environmental monitor shutdown traps
status
boolean
    Choices:
  • no
  • yes
Enable SNMP environmental status change traps
supply
boolean
    Choices:
  • no
  • yes
Enable SNMP environmental monitor supply traps
temperature
boolean
    Choices:
  • no
  • yes
Enable SNMP environmental monitor temperature traps
errdisable
boolean
    Choices:
  • no
  • yes
Enable SNMP errdisable notifications
ether_oam
boolean
    Choices:
  • no
  • yes
Enable SNMP ethernet oam traps
ethernet
dictionary
Allow ethernet traps
cfm
dictionary
Enable SNMP Ethernet CFM traps
alarm
boolean
    Choices:
  • no
  • yes
Enable SNMP Ethernet CFM fault alarm trap
cc
dictionary
Enable SNMP Ethernet CC trap
config
boolean
    Choices:
  • no
  • yes
Enable SNMP Ethernet CFM configuration error traps
cross_connect
boolean
    Choices:
  • no
  • yes
Enable SNMP Ethernet CFM cross-connect traps
loop
boolean
    Choices:
  • no
  • yes
Enable SNMP Ethernet CFM loop traps
mep_down
boolean
    Choices:
  • no
  • yes
Enable SNMP Ethernet CFM CC Down traps
mep_up
boolean
    Choices:
  • no
  • yes
Enable SNMP Ethernet CFM CC Up traps
crosscheck
dictionary
Enable SNMP Ethernet CC crosscheck trap
mep_missing
boolean
    Choices:
  • no
  • yes
Enable SNMP Ethernet CC crosscheck missing trap
mep_unknown
boolean
    Choices:
  • no
  • yes
Enable SNMP Ethernet CC crosscheck unknown traps
service_up
boolean
    Choices:
  • no
  • yes
Enable SNMP Ethernet CC crosscheck service traps
evc
dictionary
Enable SNMP Ethernet EVC traps
create
boolean
    Choices:
  • no
  • yes
Enable SNMP Ethernet EVC create traps
delete
boolean
    Choices:
  • no
  • yes
Enable SNMP Ethernet EVC delete traps
status
boolean
    Choices:
  • no
  • yes
Enable SNMP Ethernet EVC status traps
event_manager
boolean
    Choices:
  • no
  • yes
Enable SNMP event-manager traps
firewall
dictionary
Enable SNMP firewall traps
enable
boolean
    Choices:
  • no
  • yes
Enable/disable firewall traps
serverstatus
boolean
    Choices:
  • no
  • yes
Enable firewall server status change trap
flash
dictionary
SNMP FLASH notifications
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP FLASH notifications
insertion
boolean
    Choices:
  • no
  • yes
Enable SNMP Flash Insertion notifications
lowspace
boolean
    Choices:
  • no
  • yes
Enable SNMP Flash Low Space notifications
removal
boolean
    Choices:
  • no
  • yes
Enable SNMP Flash Removal notifications
flex_links
dictionary
SNMP FLEX Links traps
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP FLEX Links traps
status
boolean
    Choices:
  • no
  • yes
Enable SNMP FLEX Links status change traps
flowmon
boolean
    Choices:
  • no
  • yes
Enable SNMP flowmon traps
frame_relay
dictionary
Allow frame-relay traps
enable
boolean
    Choices:
  • no
  • yes
Enable/disable frame-relay traps
subif
dictionary
Enable SNMP frame-relay subinterface traps
count
integer
Maximum number of traps sent per interval
enable
boolean
    Choices:
  • no
  • yes
Enable/disable subif traps
interval
integer
Interval duration in which to limit the number of traps sent
fru_ctrl
boolean
    Choices:
  • no
  • yes
Enable SNMP fru-ctrl traps
hsrp
boolean
    Choices:
  • no
  • yes
Enable SNMP hsrp traps
ike
dictionary
Allow ike traps
policy
dictionary
Enable IKE Policy traps
add
boolean
    Choices:
  • no
  • yes
Enable IKE Policy add trap
delete
boolean
    Choices:
  • no
  • yes
Enable IKE Policy delete trap
tunnel
dictionary
Enable IKE Tunnel traps
start
boolean
    Choices:
  • no
  • yes
Enable IKE Tunnel start trap
stop
boolean
    Choices:
  • no
  • yes
Enable IKE Tunnel stop trap
ipmulticast
boolean
    Choices:
  • no
  • yes
Enable SNMP ip multi cast traps
ipsec
dictionary
Allow ike traps
cryptomap
dictionary
Enable IPsec Cryptomap traps
add
boolean
    Choices:
  • no
  • yes
Enable IPsec Cryptomap add trap
attach
boolean
    Choices:
  • no
  • yes
Enable IPsec Cryptomap Attach trap
delete
boolean
    Choices:
  • no
  • yes
Enable IPsec Cryptomap delete trap
detach
boolean
    Choices:
  • no
  • yes
Enable IPsec Cryptomap Detach trap
too_many_sas
boolean
    Choices:
  • no
  • yes
Enable IPsec Tunnel Start trap
tunnel
dictionary
Enable IPsec Tunnel traps
start
boolean
    Choices:
  • no
  • yes
Enable IPsec Tunnel start trap
stop
boolean
    Choices:
  • no
  • yes
Enable IPsec Tunnel stop trap
ipsla
boolean
    Choices:
  • no
  • yes
Enable SNMP ipsla traps
isis
boolean
    Choices:
  • no
  • yes
Enable SNMP isis traps
l2tc
dictionary
Allow SNMP L2 Tunnel Config traps
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP L2 Tunnel Config traps
sys_threshold
boolean
    Choices:
  • no
  • yes
Enable SNMP L2TC System threshold traps
threshold
boolean
    Choices:
  • no
  • yes
Enable SNMP L2 Tunnel Config threshold traps
l2tun
dictionary
Allow SNMP l2tun traps
pseudowire_status
boolean
    Choices:
  • no
  • yes
Enable BFD pseudo wire status traps
session
boolean
    Choices:
  • no
  • yes
Enable BFD session traps
license
boolean
    Choices:
  • no
  • yes
Enable license traps
lisp
boolean
    Choices:
  • no
  • yes
Enable SNMP LISP MIB traps
local_auth
boolean
    Choices:
  • no
  • yes
Enable SNMP local auth traps
mac_notification
dictionary
Allow SNMP MAC Notification traps
change
boolean
    Choices:
  • no
  • yes
Enable SNMP MAC Change traps
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP MAC Notification traps
move
boolean
    Choices:
  • no
  • yes
Enable SNMP MAC Move traps
threshold
boolean
    Choices:
  • no
  • yes
Enable SNMP MAC Threshold traps
memory
dictionary
Allow MEMORY traps
bufferpeak
boolean
    Choices:
  • no
  • yes
Enable SNMP Memory Bufferpeak traps
enable
boolean
    Choices:
  • no
  • yes
Enable MEMORY traps
mpls
dictionary
Enable SNMP mpls traps
fast_reroute
dictionary
Allow SNMP MPLS fast reroute traps
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP MPLS fast reroute traps
protected
boolean
    Choices:
  • no
  • yes
Enable MPLS fast reroute protection traps
ldp
dictionary
Allow SNMP MPLS label distribution protocol traps
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP MPLS label distribution protocol traps
pv_limit
boolean
    Choices:
  • no
  • yes
Enable MPLS LDP path vector limit mismatch traps
session_down
boolean
    Choices:
  • no
  • yes
Enable MPLS LDP session down traps
session_up
boolean
    Choices:
  • no
  • yes
Enable MPLS LDP session up traps
threshold
boolean
    Choices:
  • no
  • yes
Enable MPLS LDP threshold exceeded traps
rfc
dictionary
Enable SNMP MPLS RFC traps
ldp
dictionary
Allow SNMP MPLS label distribution protocol RFC traps
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP MPLS label distribution protocol RFC traps
pv_limit
boolean
    Choices:
  • no
  • yes
Enable MPLS LDP path vector limit mismatch RFC traps
session_down
boolean
    Choices:
  • no
  • yes
Enable MPLS LDP session down RFC traps
session_up
boolean
    Choices:
  • no
  • yes
Enable MPLS LDP session up RFC traps
threshold
boolean
    Choices:
  • no
  • yes
Enable MPLS LDP threshold exceeded RFC traps
traffic_eng
dictionary
Allow SNMP MPLS traffic engineering RFC traps
down
boolean
    Choices:
  • no
  • yes
Enable MPLS TE tunnel down RFC traps
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP MPLS traffic engineering RFC traps
reoptimized
boolean
    Choices:
  • no
  • yes
Enable MPLS TE tunnel reoptimized RFC traps
reroute
boolean
    Choices:
  • no
  • yes
Enable MPLS TE tunnel reroute RFC traps
up
boolean
    Choices:
  • no
  • yes
Enable MPLS TE tunnel up RFC traps
vpn
dictionary
Allow SNMP MPLS Virtual Private Network RFC traps
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP MPLS Virtual Private Network RFC traps
illegal_label
boolean
    Choices:
  • no
  • yes
Enable MPLS VPN illegal label threshold exceeded RFC traps
max_thresh_cleared
boolean
    Choices:
  • no
  • yes
Enable MPLS VPN maximum threshold cleared RFC traps
max_threshold
boolean
    Choices:
  • no
  • yes
Enable MPLS VPN maximum threshold exceeded RFC traps
mid_threshold
boolean
    Choices:
  • no
  • yes
Enable MPLS VPN middle threshold exceeded RFC traps
vrf_down
boolean
    Choices:
  • no
  • yes
Enable MPLS VPN vrf down RFC traps
vrf_up
boolean
    Choices:
  • no
  • yes
Enable MPLS VPN vrf up RFC traps
traffic_eng
dictionary
Allow SNMP MPLS traffic engineering traps
down
boolean
    Choices:
  • no
  • yes
Enable MPLS TE tunnel down traps
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP MPLS traffic engineering traps
reroute
boolean
    Choices:
  • no
  • yes
Enable MPLS TE tunnel reroute traps
up
boolean
    Choices:
  • no
  • yes
Enable MPLS TE tunnel up traps
vpn
dictionary
Allow SNMP MPLS Virtual Private Network traps
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP MPLS Virtual Private Network traps
illegal_label
boolean
    Choices:
  • no
  • yes
Enable MPLS VPN illegal label threshold exceeded traps
max_thresh_cleared
boolean
    Choices:
  • no
  • yes
Enable MPLS VPN maximum threshold cleared traps
max_threshold
boolean
    Choices:
  • no
  • yes
Enable MPLS VPN maximum threshold exceeded traps
mid_threshold
boolean
    Choices:
  • no
  • yes
Enable MPLS VPN middle threshold exceeded traps
vrf_down
boolean
    Choices:
  • no
  • yes
Enable MPLS VPN vrf down traps
vrf_up
boolean
    Choices:
  • no
  • yes
Enable MPLS VPN vrf up traps
mpls_vpn
boolean
    Choices:
  • no
  • yes
Enable SNMP mpls traps
This option is DEPRECATED and is replaced with mpls which accepts dict as input
This attribute will be removed after 2024-09-01
msdp
boolean
    Choices:
  • no
  • yes
Enable SNMP msdp traps
mvpn
boolean
    Choices:
  • no
  • yes
Enable SNMP mvpn traps
nhrp
dictionary
Allow SNMP NHRP traps
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP NHRP traps
nhc
dictionary
Allow Next Hop Client traps
down
boolean
    Choices:
  • no
  • yes
Enable Next Hop Client down trap
enable
boolean
    Choices:
  • no
  • yes
Enable Next Hop Client traps
up
boolean
    Choices:
  • no
  • yes
Enable Next Hop Client up trap
nhp
dictionary
Allow Next Hop Peer traps
down
boolean
    Choices:
  • no
  • yes
Enable Next Hop Peer down trap
enable
boolean
    Choices:
  • no
  • yes
Enable Next Hop Peer traps
up
boolean
    Choices:
  • no
  • yes
Enable Next Hop Peer up trap
nhs
dictionary
Allow Next Hop Server traps
down
boolean
    Choices:
  • no
  • yes
Enable Next Hop Server down trap
enable
boolean
    Choices:
  • no
  • yes
Enable Next Hop Server traps
up
boolean
    Choices:
  • no
  • yes
Enable Next Hop Server up trap
quota_exceeded
boolean
    Choices:
  • no
  • yes
Enable quota-exceeded trap
ospf
dictionary
Allow ospf related traps
cisco_specific
dictionary
Cisco specific traps
error
boolean
    Choices:
  • no
  • yes
error traps
lsa
boolean
    Choices:
  • no
  • yes
Lsa related traps
retransmit
boolean
    Choices:
  • no
  • yes
Packet retransmit traps
state_change
dictionary
state change traps
nssa_trans_change
boolean
    Choices:
  • no
  • yes
Nssa translator state changes
shamlink
dictionary
Config mismatch errors on virtual interfaces
interface
boolean
    Choices:
  • no
  • yes
Sham link interface state changes
neighbor
boolean
    Choices:
  • no
  • yes
Sham link neighbor state changes
error
boolean
    Choices:
  • no
  • yes
Enable error traps
lsa
boolean
    Choices:
  • no
  • yes
Enable/disable ospf lsa traps
retransmit
boolean
    Choices:
  • no
  • yes
Enable/disable ospf retransmit traps
state_change
boolean
    Choices:
  • no
  • yes
Enable/disable state change traps
ospfv3
dictionary
Allow OSPFv3 related traps
errors
dictionary
Error traps
bad_packet
boolean
    Choices:
  • no
  • yes
Packet parse failure on non-virtual interfaces
config_error
boolean
    Choices:
  • no
  • yes
Config mismatch errors on non-virtual interfaces
enable
boolean
    Choices:
  • no
  • yes
Enable Error traps
virt_bad_packet
boolean
    Choices:
  • no
  • yes
Packet parse failure on virtual interfaces
virt_config_error
boolean
    Choices:
  • no
  • yes
Config mismatch errors on virtual interfaces
rate_limit
integer
Trap rate limit values
Rate limit window size in seconds (between 2 and 60)
state_change
dictionary
State change traps
enable
boolean
    Choices:
  • no
  • yes
Enable State change traps
if_state_change
boolean
    Choices:
  • no
  • yes
Non_virtual interface state changes
neighbor_restart_helper_status_change
boolean
    Choices:
  • no
  • yes
Neighbor graceful restart helper status changes
neighbor_state_change
boolean
    Choices:
  • no
  • yes
Non_virtual neighbor state changes
nssa_translator_status_change
boolean
    Choices:
  • no
  • yes
NSSA translator status changes
restart_status_change
boolean
    Choices:
  • no
  • yes
Graceful restart status changes
virtif_state_change
boolean
    Choices:
  • no
  • yes
Virtual interface state changes
vn_restart_helper_status_change
boolean
    Choices:
  • no
  • yes
Virtual neighbor graceful restart helper status changes
vn_state_change
boolean
    Choices:
  • no
  • yes
Virtual neighbor state changes
pim
dictionary
Allow PIM traps
enable
boolean
    Choices:
  • no
  • yes
Enable/disable PIM traps
invalid_pim_message
boolean
    Choices:
  • no
  • yes
Enable invalid pim message trap
neighbor_change
boolean
    Choices:
  • no
  • yes
Enable neighbor change trap
rp_mapping_change
boolean
    Choices:
  • no
  • yes
Enable rp mapping change trap
pki
boolean
    Choices:
  • no
  • yes
Enable SNMP pki traps
port_security
boolean
    Choices:
  • no
  • yes
Enable SNMP port security traps
power_ethernet
dictionary
Allow SNMP power ethernet traps
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP power ethernet traps
group
list / elements=dictionary
Enable SNMP inline power group based traps.
slot_id
integer
An integer between 1 and 20 (physical slot number)
threshold
integer
Threshold level for this slot
police
boolean
    Choices:
  • no
  • yes
Enable Policing Trap
pw_vc
boolean
    Choices:
  • no
  • yes
Enable SNMP pw vc traps
rep
boolean
    Choices:
  • no
  • yes
Enable SNMP Resilient Ethernet Protocol Traps
rf
boolean
    Choices:
  • no
  • yes
Enable all SNMP traps defined in CISCO-RF-MIB
rsvp
boolean
    Choices:
  • no
  • yes
Enable SNMP RSVP traps
smart_license
dictionary
Allow smart license traps
enable
boolean
    Choices:
  • no
  • yes
Enable smart license traps
entitlement
boolean
    Choices:
  • no
  • yes
Enable Entitlement Notification trap
global
boolean
    Choices:
  • no
  • yes
Enable Global Notification traps
snmp
dictionary
Enable SNMP traps
authentication
boolean
    Choices:
  • no
  • yes
Enable authentication trap
coldstart
boolean
    Choices:
  • no
  • yes
Enable coldStart trap
linkdown
boolean
    Choices:
  • no
  • yes
Enable linkDown trap
linkup
boolean
    Choices:
  • no
  • yes
Enable linkUp trap
warmstart
boolean
    Choices:
  • no
  • yes
Enable warmStart trap
stackwise
boolean
    Choices:
  • no
  • yes
Enable SNMP stackwise traps
stpx
dictionary
Allow SNMP STPX MIB traps
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP STPX MIB traps
inconsistency
boolean
    Choices:
  • no
  • yes
Enable SNMP STPX MIB InconsistencyUpdate traps
loop_inconsistency
boolean
    Choices:
  • no
  • yes
Enable SNMP STPX MIB LoopInconsistencyUpdate traps
root_inconsistency
boolean
    Choices:
  • no
  • yes
Enable SNMP STPX MIB RootInconsistencyUpdate traps
syslog
boolean
    Choices:
  • no
  • yes
Enable SNMP syslog traps
transceiver_all
boolean
    Choices:
  • no
  • yes
Enable SNMP transceiver traps
trustsec
dictionary
Allow SNMP CISCO-TRUSTSEC-MIB traps
authz_file_error
boolean
    Choices:
  • no
  • yes
Enable ctsAuthzCacheFileErrNotif notifications
cache_file_error
boolean
    Choices:
  • no
  • yes
Enable ctsCacheFileAccessErrNotif notifications
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP CISCO-TRUSTSEC-MIB traps
keystore_file_error
boolean
    Choices:
  • no
  • yes
Enable ctsSwKeystoreFileErrNotif notifications
keystore_sync_fail
boolean
    Choices:
  • no
  • yes
Enable ctsSwKeystoreSyncFailNotif notifications
random_number_fail
boolean
    Choices:
  • no
  • yes
Enable ctsSapRandonNumberFailNotif notifications
src_entropy_fail
boolean
    Choices:
  • no
  • yes
Enable ctsSrcEntropyFailNotif notifications
trustsec_interface
dictionary
Allow SNMP CISCO-TRUSTSEC-INTERFACE-MIB traps
authc_fail
boolean
    Choices:
  • no
  • yes
Enable ctsiIfAuthenticationFailNotif trap
authz_fail
boolean
    Choices:
  • no
  • yes
Enable ctsiAuthorizationFailNotif trap
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP CISCO-TRUSTSEC-INTERFACE-MIB traps
sap_fail
boolean
    Choices:
  • no
  • yes
Enable ctsiIfSapNegotiationFailNotif trap
supplicant_fail
boolean
    Choices:
  • no
  • yes
Enable ctsiIfAddSupplicantFailNotif trap
unauthorized
boolean
    Choices:
  • no
  • yes
Enable ctsiIfUnauthorizedNotifEnable trap
trustsec_policy
dictionary
Allow SNMP CISCO-TRUSTSEC-POLICY-MIB traps
authz_sgacl_fail
boolean
    Choices:
  • no
  • yes
Enable ctspAuthorizationSgaclFailNotif notifications
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP CISCO-TRUSTSEC-POLICY-MIB traps
peer_policy_updated
boolean
    Choices:
  • no
  • yes
Enable ctspPeerPolicyUpdatedNotif notifications
trustsec_server
dictionary
Allow SNMP CISCO-TRUSTSEC-SERVER-MIB traps
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP CISCO-TRUSTSEC-SERVER-MIB traps
provision_secret
boolean
    Choices:
  • no
  • yes
Enable ctsvNoProvisionSecretNotif notification
radius_server
boolean
    Choices:
  • no
  • yes
Enable ctsvNoRadiusServerNotif notification
trustsec_sxp
dictionary
Allow SNMP CISCO-TRUSTSEC-SXP-MIB traps
binding_conflict
boolean
    Choices:
  • no
  • yes
Enable ctsxSxpBindingConflictNotif notifications
binding_err
boolean
    Choices:
  • no
  • yes
Enable ctsxSxpBindingErrNotif notifications
binding_expn_fail
boolean
    Choices:
  • no
  • yes
Enable ctsxSxpBindingExpnFailNotif notifications
conn_config_err
boolean
    Choices:
  • no
  • yes
Enable ctsxSxpConnConfigErrNotif notifications
conn_down
boolean
    Choices:
  • no
  • yes
Enable ctsxSxpConnDownNotif notifications
conn_srcaddr_err
boolean
    Choices:
  • no
  • yes
Enable ctsxSxpConnSourceAddrErrNotif notifications
conn_up
boolean
    Choices:
  • no
  • yes
Enable ctsxSxpConnUpNotif notifications
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP CISCO-TRUSTSEC-SXP-MIB traps
msg_parse_err
boolean
    Choices:
  • no
  • yes
Enable ctsxSxpMsgParseErrNotif notifications
oper_nodeid_change
boolean
    Choices:
  • no
  • yes
Enable ctsxSxpOperNodeIdChangeNotif notifications
tty
boolean
    Choices:
  • no
  • yes
Enable SNMP tty TCP connection traps
udld
dictionary
Allow SNMP CISCO-UDLDP-MIB traps
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP CISCO-UDLDP-MIB traps
link_fail_rpt
boolean
    Choices:
  • no
  • yes
Enable SNMP cudldpFastHelloLinkFailRptNotification traps
status_change
boolean
    Choices:
  • no
  • yes
Enable SNMP cudldpFastHelloStatusChangeNotification traps
vlan_membership
boolean
    Choices:
  • no
  • yes
Enable SNMP VLAN membership traps
vlancreate
boolean
    Choices:
  • no
  • yes
Enable SNMP VLAN created traps
vlandelete
boolean
    Choices:
  • no
  • yes
Enable SNMP VLAN deleted traps
vrfmib
dictionary
Allow vrfmib traps
vnet_trunk_down
boolean
    Choices:
  • no
  • yes
Enable vnet-trunk-down traps
vnet_trunk_up
boolean
    Choices:
  • no
  • yes
Enable vnet-trunk-up trap
vrf_down
boolean
    Choices:
  • no
  • yes
Enable vrf-down trap
vrf_up
boolean
    Choices:
  • no
  • yes
Enable vrf-up trap
vrrp
boolean
    Choices:
  • no
  • yes
Enable SNMP vrrp traps
vswitch
dictionary
Allow SNMP Virtual Switch notifications
dual_active
boolean
    Choices:
  • no
  • yes
Enable SNMP Virtual Switch (Dual Active) notification
enable
boolean
    Choices:
  • no
  • yes
Enable SNMP Virtual Switch notifications
vsl
boolean
    Choices:
  • no
  • yes
Enable SNMP Virtual Switch Link (VSL) notification
vtp
boolean
    Choices:
  • no
  • yes
Enable SNMP VTP traps
users
list / elements=dictionary
Define a user who can access the SNMP engine
acl_v4
string
Access list ipv4 associated
acl_v6
string
Access list ipv6 associated
authentication
dictionary
Authentication parameters for the user.
Effects idempotency of module as configuration applied is not reflected in running-config.
algorithm
string
    Choices:
  • md5
  • sha
Select algorithm for authentication.
password
string
Authentication password for user.
encryption
dictionary
Encryption parameters for the user.
Effects idempotency of module as configuration applied is not reflected in running-config.
password
string
Authentication password for user.
priv
string
    Choices:
  • 3des
  • aes
  • des
Select algorithm for encryption.
priv_option
string
Add extra option for specific priv if any.
group
string
SNMP group for the user.
remote
string
System where an SNMPv3 user is hosted
udp_port
integer
UDP port used by the remote SNMP system
username
string
SNMP user name
version
string
    Choices:
  • v1
  • v2c
  • v3
SNMP security version
version_option
string
    Choices:
  • encrypted
Enable encrypted version option.
vrf
string
The remote SNMP entity's VPN Routing instance
views
list / elements=dictionary
Define an SNMPv2 MIB view
excluded
boolean
    Choices:
  • no
  • yes
MIB family is excluded from the view
family_name
string
MIB view family name
included
boolean
    Choices:
  • no
  • yes
MIB family is included in the view
name
string
Name of the view
running_config
string
This option is used only with state parsed.
The value of this option should be the output received from the IOS device by executing the command show running-config | include snmp-server.
The state parsed reads the configuration from running_config option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the parsed key within the result.
state
string
    Choices:
  • merged ←
  • replaced
  • overridden
  • deleted
  • parsed
  • gathered
  • rendered
The state the configuration should be left in.
Refer to examples for more details.
The states replaced and overridden have identical behaviour for this module.

Notes ----- .. note:: - Tested against Cisco IOSXE Version 17.3 on CML. - This module works with connection ``network_cli``. Examples -------- .. code-block:: yaml # 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" # } # ] # } Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
after
dictionary
when changed
The resulting configuration after module execution.

Sample:
This output will always be in the same format as the module argspec.
before
dictionary
when state is merged, replaced, overridden, deleted or purged
The configuration prior to the module execution.

Sample:
This output will always be in the same format as the module argspec.
commands
list
when state is merged, replaced, overridden, deleted or purged
The set of commands pushed to the remote device.

Sample:
['snmp-server host 172.16.2.99 informs version 2c check msdp stun', 'snmp-server engineID remote 172.16.0.2 udp-port 23 AB0C5342FAAB', 'snmp-server group grp1 v1 notify me access 2']
gathered
list
when state is gathered
Facts about the network resource gathered from the remote device as structured data.

Sample:
This output will always be in the same format as the module argspec.
parsed
list
when state is parsed
The device native config provided in running_config option parsed into structured data as per module argspec.

Sample:
This output will always be in the same format as the module argspec.
rendered
list
when state is rendered
The provided configuration in the task rendered in device-native format (offline).

Sample:
['snmp-server enable traps ipsec cryptomap attach', 'snmp-server password-policy policy1 define max-len 24 upper-case 12 lower-case 12 special-char 32 digits 23 change 3', 'snmp-server cache interval 2']


Status ------ Authors ~~~~~~~ - Sagar Paul (@KB-perByte)