sensu_silence - Manage Sensu silence entries

New in version 2.4.

Synopsis

  • Create and clear (delete) a silence entries via the Sensu API for subscriptions and checks.

Options

parameter required default choices comments
check
no
Specifies the check which the silence entry applies to.
creator
no
Specifies the entity responsible for this entry.
expire
no
If specified, the silence entry will be automatically cleared after this number of seconds.
expire_on_resolve
no
  • yes
  • no
If specified as true, the silence entry will be automatically cleared once the condition it is silencing is resolved.
reason
no
If specified, this free-form string is used to provide context or rationale for the reason this silence entry was created.
state
yes present
  • present
  • absent
Specifies to create or clear (delete) a silence entry via the Sensu API
subscription
yes
Specifies the subscription which the silence entry applies to.
To create a silence entry for a client append client: to client name. Example - client:server1.example.dev
url
no http://127.0.01:4567
Specifies the URL of the Sensu monitoring host server.

Examples

# Silence ALL checks for a given client
- name: Silence server1.example.dev
  sensu_silence:
    subscription: client:server1.example.dev
    creator: "{{ ansible_user_id }}"
    reason: Performing maintenance

# Silence specific check for a client
- name: Silence CPU_Usage check for server1.example.dev
  sensu_silence:
    subscription: client:server1.example.dev
    check: CPU_Usage
    creator: "{{ ansible_user_id }}"
    reason: Investigation alert issue

# Silence multiple clients from a dict
  silence:
    server1.example.dev:
      reason: 'Deployment in progress'
    server2.example.dev:
      reason: 'Deployment in progress'

- name: Silence several clients from a dict
  sensu_silence:
    subscription: "client:{{ item.key }}"
    reason: "{{ item.value.reason }}"
    creator: "{{ ansible_user_id }}"
  with_dict: "{{ silence }}"

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

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