Page 1 of 1
Error: Could not open command file '/usr/local/nagios/var/rw
Posted: Mon Dec 04, 2017 11:38 am
by tanay.more
When I try to disable notification for any host it shows error as "Error: Could not open command file '/usr/local/nagios/var/rw/nagios.cmd' for update!".
Sharing screenshots for your reference.
Re: Error: Could not open command file '/usr/local/nagios/va
Posted: Mon Dec 04, 2017 2:21 pm
by mcapra
What documentation did you use to install Nagios Core?
The "Install Command Mode" step of
the official documentation typically takes care of this. Can you share the output of the following command executed from the CLI of your Nagios Core machine:
If you attempted to create that file by hand, know that it must exist as a named pipe with the sticky-bit set in the permissions.
To set the sticky-bit by hand:
Code: Select all
chmod g+s /usr/local/nagios/var/rw/
Re: Error: Could not open command file '/usr/local/nagios/va
Posted: Mon Dec 04, 2017 3:58 pm
by tgriep
Thanks
@mcapra for the help.
@tanay.more let us know if this fixes the issue.
Re: Error: Could not open command file '/usr/local/nagios/va
Posted: Mon Dec 04, 2017 11:42 pm
by tanay.more
Thanks for your help.
Please find status on your query below.
What documentation did you use to install Nagios Core?
>>I am sharing my document which I used to installed Nagios Server.
ls -al /usr/local/nagios/var/rw/
[root@blpmweb15 ~]# ls -al /usr/local/nagios/var/rw/
total 4
drwxrwsr-x 2 nagios nagcmd 39 Dec 5 10:11 .
drwxrwxr-x 5 nagios nagios 4096 Dec 5 10:12 ..
prw-rw---- 1 nagios nagcmd 0 Dec 5 10:11 nagios.cmd
srw-rw---- 1 nagios nagcmd 0 Dec 5 10:11 nagios.qh
I tried "chmod g+s /usr/local/nagios/var/rw/" this but still no fix.
Re: Error: Could not open command file '/usr/local/nagios/va
Posted: Tue Dec 05, 2017 11:32 am
by tgriep
Another thing to check is to make sure the nagios user account and the apache user account is added to the nagcmd group and the nagios group on the server.
To do this, edit the following file
And make sure the nagios and nagcmd groups are configured like the example below.
Code: Select all
nagios:x:1000:nagios,apache
nagcmd:x:1001:nagios,apache
This should allow the nagios user and the apache user account access to that folder and it's files.