derjd.icinga2downtime
icinga2downtime
This tool allows you to add or remove downtimes in Icinga2 using the API. There is a Github Issue for making this feature a module, but the last update was in 2018. Currently, it puts downtimes for a host and all related services. To remove a downtime, it uses a comment and the host information.
Requirements
None at the moment.
Variables
There are several default settings. Usually, just using dt_icinga
, dt_user
, and dt_pass
is enough.
Variable | Default | Description |
---|---|---|
i2d_icinga | None | The Icinga2 server to connect to |
i2d_port | 5665 | The port for Icinga2 |
i2d_user | icinga2 | Username for login |
i2d_pass | icinga2 | Password for login |
i2d_host | "{{ hostvars[inventory_hostname].ansible_host | default(inventory_hostname) }}" |
i2d_msg | 'downtimed with ansible-role icinga2downtime' | Message shown during downtime |
i2d_author | "{{ lookup('env','USER') }}" | Name shown in downtime |
i2d_from | 'now' | Start time for downtime (translated by date ) |
i2d_until | '+2 hours' | End time for downtime (translated by date ) |
i2d_add | no | Set to yes to add downtime |
i2d_remove | no | Set to yes to remove downtime |
Dependencies
None at the moment.
Example
---
- hosts: all
gather_facts: 'no'
vars:
i2d_icinga: icinga2.example.com
i2d_user: derJD
i2d_pass: VeryVerySecret!1
tasks:
- include_role:
name: derJD.icinga2downtime
apply:
delegate_to: localhost
vars: { i2d_add: "yes" }
- [do something fancy]
- include_role:
name: derJD.icinga2downtime
apply:
delegate_to: localhost
vars: { i2d_remove: "yes" }
License
BSD
Author Information
Installa
ansible-galaxy install derjd.icinga2downtime
Licenza
Unknown
Download
8.1k
Proprietario