.. _vyos.rest.vyos_snmp_server_module: ************************** vyos.rest.vyos_snmp_server ************************** **Manage SNMP server configuration on VyOS devices using REST API** Version added: 1.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - Manages SNMP server configuration on VyOS devices via the REST API. - Supports communities, listen addresses, contact/location/description, trap target, and SNMPv3 (engine ID, groups, users, views). - Uses REST API (``connection=httpapi``) instead of CLI. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
config
dictionary
SNMP server configuration.
communities
list / elements=dictionary
SNMP community configuration.
authorization_type
string
    Choices:
  • ro
  • rw
Authorization type (ro=read-only, rw=read-write).
clients
list / elements=string
IP addresses of SNMP clients allowed to contact the system.
name
string / required
Community name.
networks
list / elements=string
Subnets of SNMP clients allowed to contact the system.
contact
string
Contact person for the system.
description
string
System description.
listen_addresses
list / elements=dictionary
IP addresses to listen for incoming SNMP requests.
address
string / required
IP address to listen on.
port
integer
UDP port (default 161).
location
string
System location.
smux_peer
string
Register a subtree for SMUX-based processing.
snmp_v3
dictionary
SNMPv3 configuration.
engine_id
string
EngineID as a hex string.
groups
list / elements=dictionary
SNMPv3 group configuration.
group
string / required
Group name.
mode
string
    Choices:
  • ro
  • rw
Access mode (ro=read-only, rw=read-write).
seclevel
string
    Choices:
  • auth
  • priv
Minimum security level required for group members.
view
string
View name the group has access to.
trap_targets
list / elements=dictionary
SNMPv3 trap target configuration.
address
string
IP address of the SNMPv3 trap target.
authentication
dictionary
Authentication parameters for trap target.
encrypted_key
string
Encrypted authentication key.
plaintext_key
string
Plaintext authentication key.
type
string
Authentication algorithm.
port
integer
UDP port on the trap target host.
privacy
dictionary
Privacy parameters for trap target.
encrypted_key
string
Encrypted privacy key.
plaintext_key
string
Plaintext privacy key.
type
string
Privacy algorithm.
protocol
string
    Choices:
  • tcp
  • udp
Transport protocol for traps.
type
string
    Choices:
  • inform
  • trap
Trap type.
users
list / elements=dictionary
SNMPv3 user configuration.
authentication
dictionary
Authentication parameters for this user.
encrypted_key
string
Encrypted authentication key (stored as encrypted-password on device).
plaintext_key
string
Plaintext authentication key (device encrypts it).
type
string
Authentication algorithm.
group
string
Group this user belongs to.
mode
string
    Choices:
  • ro
  • rw
Access mode for this user.
privacy
dictionary
Privacy (encryption) parameters for this user.
encrypted_key
string
Encrypted privacy key.
plaintext_key
string
Plaintext privacy key (device encrypts it).
type
string
Privacy algorithm.
tsm_key
string
TSM fingerprint of the certificate mapped to this user.
user
string / required
Username.
views
list / elements=dictionary
SNMPv3 view configuration.
exclude
string
OID subtree excluded from this view.
mask
string
OID mask for the view.
oid
string
OID subtree included in this view.
view
string / required
View name.
trap_source
string
SNMP trap source address.
trap_target
dictionary
SNMP trap target.
address
string
IP address of the trap target host.
community
string
Community name to use for traps.
port
integer
UDP port on the trap target host.
state
string
    Choices:
  • merged ←
  • replaced
  • overridden
  • deleted
  • gathered
Desired state of SNMP configuration.

Examples -------- .. code-block:: yaml - name: Merge SNMP configuration vyos.rest.vyos_snmp_server: config: communities: - name: switches authorization_type: rw - name: bridges clients: - 1.1.1.1 - 12.1.1.10 contact: admin2@ex.com listen_addresses: - address: 20.1.1.1 - address: 100.1.2.1 port: 33 snmp_v3: users: - user: admin_user authentication: plaintext_key: abc1234567 type: sha privacy: plaintext_key: abc1234567 type: aes state: merged - name: Delete all SNMP configuration vyos.rest.vyos_snmp_server: state: deleted - name: Gather current SNMP configuration vyos.rest.vyos_snmp_server: state: gathered 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
SNMP configuration after this module ran.

before
dictionary
when state is merged, replaced, overridden or deleted
SNMP configuration before this module ran.

commands
list
always
List of API command dicts sent to the device.

gathered
dictionary
when state is gathered
Current SNMP configuration as structured data.

saved
boolean
when changes are applied
Whether the config was saved after changes.



Status ------ Authors ~~~~~~~ - your_name (@yourhandle)