Error: Could not open command file ‘/usr/local/nagios/var/rw/nagios.cmd’ for update!



I recently got this error while updating my system.

Nagios

Error: Could not open command file ‘/usr/local/nagios/var/rw/nagios.cmd’ for update!

After messing up a bit with the file system, I found out that the permissions were not correct. You can set up the correct permissions using the following commands.

chcon -R -t httpd_sys_script_rw_t /usr/local/nagios/var/rw

Now run the update again. You’ll not get the error.

Another fix for the error is to edit the /etc/group. In the terminal type the following:

nano /etc/group

Look for the values named Nagios and nagcmd. Add www-data in them. The values should look something like this:

nagios: x: 1003:
nagios, www-data

nagcmd: x: 1004:
nagios, www-data

Now, restart Apache2.

Leave a Reply

Your email address will not be published. Required fields are marked *