Nagios module and not being able to write to nagios.cmd

120 views
Skip to first unread message

Samnang Sen

unread,
Sep 16, 2015, 4:59:04 PM9/16/15
to Ansible Project
I keep getting the following error when I attempt to disable alerts for a particular host. Not sure what the heck is going on!

failed: [127.0.0.1 -> nagios.xyz.net] => {"cmdfile": "/var/spool/nagios/cmd/nagios.cmd", "failed": true}
msg: unable to write to nagios command file


Permissions to file (My user is in the "nagios" group):
prwxrwx---. 1 nagios nagios    0 Sep  4 15:47 nagios.cmd


pre_tasks:
  - name: disable nagios alerts for this host webserver service
    nagios: action=disable_alerts host=qcweb001 service=all cmdfile=/var/spool/nagios/cmd/nagios.cmd
    delegate_to: nagios.xyz.net

Samnang Sen

unread,
Sep 16, 2015, 5:02:41 PM9/16/15
to Ansible Project
In addition can someone clarify something.

Shouldn't the "cmdfile" file be the .cmd file? I peeked at the Nagios module and there's a list of files but they all point to the nagios.cfg file. 

Brian Coca

unread,
Sep 18, 2015, 12:48:05 PM9/18/15
to Ansible Project
So the user you login to the nagios server needs to be in the nagios
group to write to the file.



--
Brian Coca

Samnang Sen

unread,
Sep 18, 2015, 12:49:27 PM9/18/15
to Ansible Project
Thought I included that in my original post but I didn't. Yes the user I am logging in as is in the "nagios" group.

Brian Coca

unread,
Sep 18, 2015, 12:53:45 PM9/18/15
to Ansible Project
are you sure? try delegating a "shell: id" task


--
Brian Coca
Reply all
Reply to author
Forward
0 new messages