Nagios:错误:无法打开命令文件/usr/local/nagios/var/rw/nagios.cmd

时间:2015-07-03 10:40:18

标签: php nginx nagios

我在这里阅读了很多答案并且用Google搜索了一些 - 但是无法使其正常工作。

Nagios 4.1; CentOS 7.0; Nginx 1.6.3;

nagios群组有nginx个用户:

# cat /etc/group | grep nagios
nagios:x:994:apache,nginx,nagios

目录和文件拥有nagios群组的权限:

# ls -l /usr/local/nagios/var/ | grep rw
...
drwxrwsr-x 2 nagios nagios    61 Jul  3 10:12 rw

# ls -l /usr/local/nagios/var/rw/
total 0
prw-rw---- 1 nagios nagios 0 Jul  3 10:24 nagios.cmd
srw-rw---- 1 nagios nagios 0 Jul  3 10:12 nagios.qh

PHP-FPM池还使用nagios用户和组:

# cat /etc/php-fpm.d/nagios.conf | grep -E 'user|group'
;listen.group = nagios
user = nagios
group = nagios

但每次重启后 - 我仍然有“无法打开命令文件/usr/local/nagios/var/rw/nagios.cmd”。

1 个答案:

答案 0 :(得分:0)

Chown for /usr/local/nagios/var/rw//usr/local/nagios/var/rw/nagios.cmd hepled:

# ls -l /usr/local/nagios/var/rw/nagios.cmd
prw-rw---- 1 nagios nginx 0 Jul  3 10:45 /usr/local/nagios/var/rw/nagios.cmd

# ls -l /usr/local/nagios/var/
total 148
...
drwxrwsr-x 2 nginx  nginx     61 Jul  3 10:45 rw