cisco.meraki.meraki_alert – Manage alerts in the Meraki cloud

From Get docs
Ansible/docs/2.10/collections/cisco/meraki/meraki alert module


cisco.meraki.meraki_alert – Manage alerts in the Meraki cloud

Note

This plugin is part of the cisco.meraki collection (version 2.1.3).

To install it use: ansible-galaxy collection install cisco.meraki.

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


New in version 2.1.0: of cisco.meraki


Synopsis

  • Allows for creation, management, and visibility into alert settings within Meraki.

Parameters

Parameter Choices/Defaults Comments

alerts

list / elements=dictionary

Alert-specific configuration for each type.

alert_destinations

dictionary

A hash of destinations for this specific alert.

all_admins

boolean

  • no
  • yes

If true, all network admins will receive emails.

emails

list / elements=string

A list of emails that will recieve the alert(s).

http_server_ids

list / elements=string

A list of HTTP server IDs to send a Webhook to.

snmp

boolean

  • no
  • yes

If true, then an SNMP trap will be sent if there is an SNMP trap server configured for this network.

alert_type

string

The type of alert.

enabled

boolean

  • no
  • yes

A boolean depicting if the alert is turned on or off.

filters

raw

A hash of specific configuration data for the alert. Only filters specific to the alert will be updated.

No validation checks occur against filters.

auth_key

string / required

Authentication key provided by the dashboard. Required if environmental variable MERAKI_KEY is not set.

default_destinations

dictionary

Properties for destinations when alert specific destinations aren't specified.

all_admins

boolean

  • no
  • yes

If true, all network admins will receive emails.

emails

list / elements=string

A list of emails that will recieve the alert(s).

http_server_ids

list / elements=string

A list of HTTP server IDs to send a Webhook to.

snmp

boolean

  • no
  • yes

If true, then an SNMP trap will be sent if there is an SNMP trap server configured for this network.

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 number of a network.

net_name

string

Name of a network.


aliases: name, network

org_id

string

ID of organization.

org_name

string

Name of organization.


aliases: organization

output_format

string

  • snakecase

  • camelcase

Instructs module whether response keys should be snake case (ex. net_id) or camel case (ex. netId).

output_level

string

  • debug
  • normal

Set amount of debug output during module execution.

rate_limit_retry_time

integer

Default:

165

Number of seconds to retry if rate limiter is triggered.

state

string

  • present

  • query

Create or modify an alert.

timeout

integer

Default:

30

Time to timeout for HTTP requests.

use_https

boolean

  • no
  • yes

If no, it will use HTTP. Otherwise it will use HTTPS.

Only useful for internal Meraki developers.

use_proxy

boolean

  • no

  • yes

If no, it will not use a proxy, even if one is defined in an environment variable on the target hosts.

validate_certs

boolean

  • 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: Update settings
  meraki_alert:
    auth_key: abc123
    org_name: YourOrg
    net_name: YourNet
    state: present
    default_destinations:
      emails:
      - 'youremail@yourcorp'
      - 'youremail2@yourcorp'
      all_admins: yes
      snmp: no
    alerts:
      - type: "gatewayDown"
        enabled: yes
        filters:
          timeout: 60
        alert_destinations:
          emails:
          - 'youremail@yourcorp'
          - 'youremail2@yourcorp'
          all_admins: yes
          snmp: no
      - type: "usageAlert"
        enabled: yes
        filters:
          period: 1200
          threshold: 104857600
        alert_destinations:
          emails:
          - 'youremail@yourcorp'
          - 'youremail2@yourcorp'
          all_admins: yes
          snmp: no

- name: Query all settings
  meraki_alert:
    auth_key: abc123
    org_name: YourOrg
    net_name: YourNet
    state: query
  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

info

Information about the created or manipulated object.


alerts

complex

success

Alert-specific configuration for each type.


alert_destinations

complex

success

A hash of destinations for this specific alert.


all_admins

boolean

success

If true, all network admins will receive emails.


emails

list / elements=string

success

A list of emails that will recieve the alert(s).


http_server_ids

list / elements=string

success

A list of HTTP server IDs to send a Webhook to.


snmp

boolean

success

If true, then an SNMP trap will be sent if there is an SNMP trap server configured for this network.


enabled

boolean

success

A boolean depicting if the alert is turned on or off.


filters

complex

success

A hash of specific configuration data for the alert. Only filters specific to the alert will be updated.

No validation checks occur against filters.


type

string

success

The type of alert.


default_destinations

complex

success

Properties for destinations when alert specific destinations aren't specified.


all_admins

boolean

success

If true, all network admins will receive emails.


Sample:

True

emails

list / elements=string

success

A list of emails that will recieve the alert(s).


http_server_ids

list / elements=string

success

A list of HTTP server IDs to send a Webhook to.


snmp

boolean

success

If true, then an SNMP trap will be sent if there is an SNMP trap server configured for this network.


Sample:

True




Authors

  • Kevin Breit (@kbreit)

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