Disable Nagios Alerts

246 views
Skip to first unread message

veera kumar

unread,
Oct 2, 2015, 7:45:08 AM10/2/15
to Ansible Project
Hi All,

Can anyone tell me how to automatically disable nagios and new relic alerts using ansible playbook. If possible please provide some samples.

Thanks in advance.

Regards,
Veera

Dimitri Yioulos

unread,
Oct 2, 2015, 10:02:13 AM10/2/15
to Ansible Project
Veera,

There's an Ansible module for nagios:  http://docs.ansible.com/ansible/nagios_module.html.  I use it, and it works well.

Dimitri

Dimitri Yioulos

unread,
Oct 9, 2015, 2:29:07 PM10/9/15
to Ansible Project
Veera,

I got your request for an example off-list, but thought I'd post it here:

---

- hosts: all
  gather_facts: true
#  sudo: yes

  tasks:
    - nagios: action=downtime minutes=5 author="Dimitri Yioulos" service=host host={{item}}
      with_items: "{{ groups['test'] }}"
      delegate_to: admin2
      tags:
         - nagios_downtime
    - nagios: action=downtime minutes=5 author="Dimitri Yioulos" service=all host={{item}}
      with_items: "{{ groups['test'] }}"
      delegate_to: admin2
      tags:
         - nagios_downtime

These tasks put all of the hosts in the 'test' group, and their services, in Downtime for five minutes.  The Nagios server is admin2.  With hosts and their services in Downtime I can, of course, reboot the hosts without setting off alerts.

HTH.

Dimitri 

On Friday, October 2, 2015 at 7:45:08 AM UTC-4, veera kumar wrote:
Reply all
Reply to author
Forward
0 new messages