Sam_S
(Sam S)
1
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
Sam_S
(Sam S)
2
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
(Brian Coca)
3
So the user you login to the nagios server needs to be in the nagios
group to write to the file.
Sam_S
(Sam S)
4
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
(Brian Coca)
5
are you sure? try delegating a "shell: id" task