Thursday 10 March 2016

Error: Could not stat() command file '/usr/local/nagios/var/rw/nagios.cmd'!

I encountered this error after a fresh install of NAGIOS and attempting to disable a check from the web GUI.

There are two areas to check:

- Firstly if you are using something like CentOS - ensure that SELinux is not interfering - you can do this by issuing:

cat /etc/sysconfig/selinux

and ensure the 'SELINUX' is set to 'permissive' e.g.

SELINUX=permissive

OR better yet create an exception for httpd:

sudo vi /etc/selinux/targeted/booleans

and add / append:

httpd_disable_trans=1

Now restart the httpd server:

sudo setsebool httpd_disable_trans 1
sudo service httpd restart

The second check is to ensure that the permissions on the folder are correct:

chown nagios.nagcmd /usr/local/nagios/var/rw
chmod g+rwx /usr/local/nagios/var/rw
chmod g+s /usr/local/nagios/var/rw

and restart httpd:

sudo service httpd restart


0 comments:

Post a Comment