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:
>
> 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
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/add2aeb8-6d50-4731-b880-2b68be94baae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to