Could not open command file '/usr/local/nagios/var/rw/nagios.cmd'

Morris, Patrick patrick.morris at hp.com
Sun May 18 19:34:31 CEST 2008


> I've update the Nagios version from 3.0b5 to 3.0.1 stable. But
> re-scheduling a new check for a service I get:
>
> -----------------------------------------------------------------------
> --
> Error: Could not open command file
> '/usr/local/nagios/var/rw/nagios.cmd'
> for update!
>
> The permissions on the external command file and/or directory may be
> incorrect. Read the FAQs on how to setup proper permissions.
>
> An error occurred while attempting to commit your command for
> processing.
> -----------------------------------------------------------------------
> --
>
> sparky:/usr/local/nagios/var/rw# ll
> total 0
> prw-rw---- 1 nagios nagios 0 2008-05-18 10:38 nagios.cmd
> sparky:/usr/local/nagios/var/rw# id nagios
> uid=1001(nagios) gid=1001(nagios) groups=1001(nagios),1002(nagcmd)
> sparky:/usr/local/nagios/var/rw# id www-data
> uid=33(www-data) gid=33(www-data) groups=33(www-data),1002(nagcmd)
>
> The permissions are according to Ubuntu Quickstart. Changing the group
> of nagios.cmd to nagcmd I get rid of the problem. But restarting
> Nagios,
> the nagios.cmd permissions are reset to nagios:nagios. What can be the
> problem?

Sounds like when you updated you compiled with a different user and/or group than your older version.

There are at least a couple ways to fix this. One would be to recompile Nagios to use a group your webserver is a member of.  Another would be to set the "rw" directory setgid www-data so new files created there have that as their group. For that to work, the nagios user would also need to be a member of www-data.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list