我在这里阅读了很多答案并且用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”。
答案 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