ITPub博客

首页 > 应用开发 > IT综合 > Could not open command file '/usr/local/nagios/var/rw/nagios.cmd' for update!

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

原创 IT综合 作者:Michael_DD 时间:2015-06-04 08:59:49 0 删除 编辑
Could not open command file '/usr/local/nagios/var/rw/nagios.cmd' for update!



通过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组就应该可以了的
但是这个却不行,就将rw这个目录及其子文件的权限改了777,这样就可以了.


后来发现nagios.cmd的权限还是自动变回了rw-rw----,但是发命令没有受到影响,不报错了.(难道是用重启nagios,让其生效)
 


比如有用户:lyon,现想要将lyon加入到dba组中。
如果是刚开始创建用户,可以通过指定-g来指定用户的组(-G参数限制用户唯一的组)
但是现在用户已经建好,只是要将lyon用户加到dba组中。
一个很简单的问题,却不知道怎么做。google了下,直接编辑/etc/group文件
找到指定的要增加到的组的名称,如dba组,然后在最后的用户列表里面添加即可。
如原来是dba:x:504:oracle,则添加后如下:dba:x:504:oracle,lyon。


/etc/group的各列含义:
它总共分四个部分:
[组名]:[密码域]:[GID]:[组员列表]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29500582/viewspace-1685003/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-02-22

  • 博文量
    326
  • 访问量
    2671974