# Nagios play fails

**URL:** <https://forum.ansible.com/t/nagios-play-fails/20907>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [March 17, 2016, 5:25pm UTC](https://forum.ansible.com/t/nagios-play-fails/20907 "2016-03-17T17:25:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dyioulos](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dyioulos/32/8363_2.png) [@dyioulos](https://forum.ansible.com/u/dyioulos)\
**Post date:** [March 17, 2016, 5:25pm UTC](https://forum.ansible.com/t/nagios-play-fails/20907/1 "2016-03-17T17:25:01Z")

</div>

I’m trying to quiet Nagios alerts after a Windows update, but before reboot. I call the playbook like this:

ansible-playbook -l ws0 win\_updatelyrisserversB.yml (with or without -u)

Here are the relevant parts of my playbook:

- hosts: all  
gather\_facts: false

tasks:

- name: win update  
win\_updates:  
category: [‘SecurityUpdates’,‘CriticalUpdates’,‘Updates’,‘Tools’,‘DefinitionUpdates’,‘UpdateRollups’]  
register: reboot\_hint  
tags:

- update

- hosts: all  
gather\_facts: false  
sudo: yes

tasks:

- nagios: action=downtime minutes=5 author=“Dimitri Yioulos” service=host host={{item}}

# with\_items: “{{ play\_hosts }}”

# with\_items: “{{ groups[‘lyris’] }}”

with\_items:

- ws0  
delegate\_to: admin2

# when: hostvars[item][‘reboot\_hint’][‘reboot\_required’]

# when: [‘reboot\_hint.reboot\_required’]

tags:

- nagios\_downtime
- nagios: action=downtime minutes=5 author=“Dimitri Yioulos” service=all host={{item}}

# with\_items: “{{ play\_hosts }}”

# with\_items: “{{ groups[‘lyris’] }}”

with\_items:

- ws0  
delegate\_to: admin2

# when: hostvars[item][‘reboot\_hint’][‘reboot\_required’]

# when: [‘reboot\_hint.reboot\_required’]

tags:

- nagios\_downtime

- hosts: all  
gather\_facts: false

tasks:

- name: reboot server  
raw: ‘cmd /c shutdown /r /t 0’  
when: reboot\_hint.reboot\_required == true  
tags:
- reboot

The Nagios play fails like this:

TASK: [nagios action=downtime minutes=5 author=“Dimitri Yioulos” service=host host={{item}}] \*\*\*  
fatal: [ws0 → admin2] =\> Authentication failure.

FATAL: all hosts have already failed – aborting

As you can see from the commented out parts of the Nagios play, I’ve tried several things (many not shown) to try and make this work, if even possible. Can anyone help?

Thanks.
