cisco.meraki.meraki_snmp – Manage organizations in the Meraki cloud

Note

This plugin is part of the cisco.meraki collection (version 2.5.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.meraki.

To use it in a playbook, specify: cisco.meraki.meraki_snmp.

Synopsis

  • Allows for management of SNMP settings for Meraki.

Parameters

Parameter Choices/Defaults Comments
access
string
    Choices:
  • community
  • none
  • users
Type of SNMP access.
auth_key
string / required
Authentication key provided by the dashboard. Required if environmental variable MERAKI_KEY is not set.
community_string
string
SNMP community string.
Only relevant if access is set to community.
host
string
Default:
"api.meraki.com"
Hostname for Meraki dashboard.
Can be used to access regional Meraki environments, such as China.
internal_error_retry_time
integer
Default:
60
Number of seconds to retry if server returns an internal server error.
net_id
string
ID of network.
net_name
string
Name of network.
org_id
string
ID of organization.
org_name
string
Name of organization.

aliases: organization
output_format
string
    Choices:
  • snakecase
  • camelcase
Instructs module whether response keys should be snake case (ex. net_id) or camel case (ex. netId).
output_level
string
    Choices:
  • debug
  • normal
Set amount of debug output during module execution.
peer_ips
list / elements=string
List of IP addresses which can perform SNMP queries.
rate_limit_retry_time
integer
Default:
165
Number of seconds to retry if rate limiter is triggered.
state
string
    Choices:
  • query
  • present
Specifies whether SNMP information should be queried or modified.
timeout
integer
Default:
30
Time to timeout for HTTP requests.
use_https
boolean
    Choices:
  • no
  • yes
If no, it will use HTTP. Otherwise it will use HTTPS.
Only useful for internal Meraki developers.
use_proxy
boolean
    Choices:
  • no
  • yes
If no, it will not use a proxy, even if one is defined in an environment variable on the target hosts.
users
list / elements=dictionary
Information about users with access to SNMP.
Only relevant if access is set to users.
passphrase
string
Passphrase for user SNMP access.
username
string
Username of user with access.
v2c_enabled
boolean
    Choices:
  • no
  • yes
Specifies whether SNMPv2c is enabled.
v3_auth_mode
string
    Choices:
  • MD5
  • SHA
Sets authentication mode for SNMPv3.
v3_auth_pass
string
Authentication password for SNMPv3.
Must be at least 8 characters long.
v3_enabled
boolean
    Choices:
  • no
  • yes
Specifies whether SNMPv3 is enabled.
v3_priv_mode
string
    Choices:
  • DES
  • AES128
Specifies privacy mode for SNMPv3.
v3_priv_pass
string
Privacy password for SNMPv3.
Must be at least 8 characters long.
validate_certs
boolean
    Choices:
  • no
  • yes
Whether to validate HTTP certificates.

Notes

Note

  • More information about the Meraki API can be found at https://dashboard.meraki.com/api_docs.
  • Some of the options are likely only used for developers within Meraki.
  • As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the ANSIBLE_MERAKI_FORMAT environment variable to camelcase.
  • Ansible’s Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
  • Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.

Examples

- name: Query SNMP values
  meraki_snmp:
    auth_key: abc12345
    org_name: YourOrg
    state: query
  delegate_to: localhost

- name: Enable SNMPv2
  meraki_snmp:
    auth_key: abc12345
    org_name: YourOrg
    state: present
    v2c_enabled: yes
  delegate_to: localhost

- name: Disable SNMPv2
  meraki_snmp:
    auth_key: abc12345
    org_name: YourOrg
    state: present
    v2c_enabled: no
  delegate_to: localhost

- name: Enable SNMPv3
  meraki_snmp:
    auth_key: abc12345
    org_name: YourOrg
    state: present
    v3_enabled: true
    v3_auth_mode: SHA
    v3_auth_pass: ansiblepass
    v3_priv_mode: AES128
    v3_priv_pass: ansiblepass
    peer_ips: 192.0.1.1;192.0.1.2
  delegate_to: localhost

- name: Set network access type to community string
  meraki_snmp:
    auth_key: abc1235
    org_name: YourOrg
    net_name: YourNet
    state: present
    access: community
    community_string: abc123
  delegate_to: localhost

- name: Set network access type to username
  meraki_snmp:
    auth_key: abc1235
    org_name: YourOrg
    net_name: YourNet
    state: present
    access: users
    users:
      - username: ansibleuser
        passphrase: ansiblepass
  delegate_to: localhost

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
data
complex
always
Information about SNMP settings.

access
string
success, when network specified
Type of SNMP access.

community_string
string
success, when network specified
SNMP community string. Only relevant if access is set to community.

hostname
string
success and no network specified.
Hostname of SNMP server.

Sample:
n1.meraki.com
peer_ips
string
success and no network specified.
Semi-colon delimited list of IPs which can poll SNMP information.

Sample:
192.0.1.1
port
string
success and no network specified.
Port number of SNMP.

Sample:
16100
users
complex
success
Information about users with access to SNMP. Only relevant if access is set to users.

passphrase
string
success, when network specified
Passphrase for user SNMP access.

username
string
success, when network specified
Username of user with access.

v2_community_string
string
When SNMPv2c is enabled and no network specified.
Automatically generated community string for SNMPv2c.

Sample:
o/8zd-JaSb
v2c_enabled
boolean
success and no network specified.
Shows enabled state of SNMPv2c

Sample:
True
v3_auth_mode
string
success and no network specified.
The SNMP version 3 authentication mode either MD5 or SHA.

Sample:
SHA
v3_enabled
boolean
success and no network specified.
Shows enabled state of SNMPv3

Sample:
True
v3_priv_mode
string
success and no network specified.
The SNMP version 3 privacy mode DES or AES128.

Sample:
AES128
v3_user
string
When SNMPv3c is enabled and no network specified.
Automatically generated username for SNMPv3.

Sample:
o/8zd-JaSb


Authors

  • Kevin Breit (@kbreit)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/cisco/meraki/meraki_snmp_module.html