Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I see an error while using NConf interface in Generate Nagios config

Error accessing or executing Nagios / Icinga binary '/usr/sbin/nagios'.
Cannot run the mandatory syntax check.

I checked Apache Error_log and it says:

sh: /usr/sbin/nagios: Permission denied

I tried changing permissions and ownership but no change.

How can I fix this?

Edit:


ls -l /usr/sbin/nagios

-rwxrwxrwx. 1 apache apache 644184 Jul 2 02:10 /usr/sbin/nagios


ps -ef | egrep 'httpd|apache'

root      4175     1  0 10:50 ?        00:00:00 /usr/sbin/httpd
apache    4177  4175  0 10:50 ?        00:00:00 /usr/sbin/httpd
apache    4178  4175  0 10:50 ?        00:00:00 /usr/sbin/httpd
apache    4179  4175  0 10:50 ?        00:00:00 /usr/sbin/httpd
apache    4180  4175  0 10:50 ?        00:00:00 /usr/sbin/httpd
apache    4181  4175  0 10:50 ?        00:00:00 /usr/sbin/httpd
apache    4182  4175  0 10:50 ?        00:00:00 /usr/sbin/httpd
apache    4183  4175  0 10:50 ?        00:00:00 /usr/sbin/httpd
apache    4184  4175  0 10:50 ?        00:00:00 /usr/sbin/httpd
apache    4559  4175  0 11:31 ?        00:00:00 /usr/sbin/httpd
root      4888  4854  0 12:26 pts/1    00:00:00 egrep httpd|apache
share|improve this question
1  
ls -l /usr/sbin/nagios? ps -ef | egrep 'httpd|apache'? –  quanta Dec 18 '12 at 8:25
    
Thank you, I added the results to my question. –  Zim3r Dec 18 '12 at 8:58
2  
1. NEVER chmod 777. 2. Are you running SELinux? 3. What does su - apache -s /bin/bash -c '/usr/sbin/nagios -V' say? –  quanta Dec 18 '12 at 9:10
    
Thanks a lot, yes I was running SELinux. Disabling SELinux fixed the problem. –  Zim3r Dec 18 '12 at 11:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.