通过web界面修改某个服务时报错

例如对某个服务进行临时安排其执行时间,或者不让它发警告,web页面上都有这样的设置.但是常常会有错误信息如下:
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.
 
关于这部分在nagios.cfg中有下面的内容
# EXTERNAL COMMAND FILE
# This is the file that Nagios checks for external command requests.
# It is also where the command CGI will write commands that are submitted
# by users, so it must be writeable by the user that the web server
# is running as (usually 'nobody').  Permissions should be set at the
# directory level instead of on the file, as the file is deleted every
# time its contents are processed.
这段话的核心意思是 apache 的运行用户要有对文件写的权限 . 权限应该设置在目录上 , 因为每次文件的内容被处理后文件就会被删掉
 
command_file=/usr/local/nagios/var/rw/nagios.cmd
apache2运行的用户apache加到nagios组就应该可以了的