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!



通过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博客 ” ,链接:http://blog.itpub.net/29500582/viewspace-1685003/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29500582/viewspace-1685003/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值