Nagios - Could not open command file /usr/local/nagios/var/rw/nagios.cmd’ for update

老子叫甜甜 提交于 2019-12-05 12:29:36

This command is wrong:

usermod -a -G nagios apache

The group permissions on your rw directory and nagios.cmd file are nagcmd, not nagios. You need this, instead:

usermod -a -G nagcmd apache

This is what worked for me - or more specifically, on Ubuntu, it's:

usermod -a -G nagios www-data

Selinux can also cause this problem. You can check its status with:

sestatus

If current mode is enforcing, change it to permissive with:

setenforce 0

Then you may be able to commit your changes into nagios.cmd.

decimal

This is how you have to follow

service httpd stop

service nagios stop


usermod -G nagcmd nagios

usermod -G nagcmd apache

chown nagios:nagcmd /usr/local/nagios/var/rw

chown nagios:nagcmd /usr/local/nagios/var/rw/nagios.cmd


service httpd start

service nagios start
Julio Ramos

The following should fix the issue in Debian:

chown -R www-data:www-data /usr/local/nagios/var/

The only issue with this is selinux. Stop it and it will work fine. Credit goes to Nagios team.

I haven't seen this mentioned and it caught me out, it's worth checking the apache child processes are running as the apache user.

I built my apache from source and this uses daemon as the default user and group for the child processes so this had to be changed for this to work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!