If you are running RHEL/CentOS and using SELinux, and you should... be using SELinux... you may have notced the following error when you attempt to submit an immediate check of a host: Error: Could not stat() command file '/usr/local/nagios/var/rw/nagios.cmd'! There are a number of ways to see if SELinux is preventing this from working, but the quickest is to # setenforce 0 -- retry submitting # setenforce 1 If the above allowed the command to run, then just run this [root@apoc rw]# chcon -R --reference=/var/www/html /usr/local/nagios/share [root@apoc rw]# chcon -R --reference=/var/www/html /usr/local/nagios/var [root@apoc rw]# chcon -R --reference=/var/www/cgi-bin /usr/local/nagios/sbin [root@apoc rw]# chcon -R -t httpd_sys_rw_content_t /usr/local/nagios/var/rw
Linux: The whole world made it for you... This blog is a collection of things I come across either at home or at work as a Linux Administrator. I have worked as an Admin working with Solaris, SAN, Backups and Linux at the Enterprise level for over 16 years.