Permission denied: exec of '/usr/local/nagios/sbin/status.cgi' failed

nagios登陆正常,但是访问所有的服务出错,检查nagios的配置文件,是正确的

在 /var/log/httpd error_log中发现出现以下错误:

 

[Mon Jul 16 17:29:23 2012] [error] [client 192.168.1.212] (13)Permission denied: exec of '/usr/local/nagios/sbin/status.cgi' failed,
referer: http://192.168.1.217/nagios/side.php
[Mon Jul 16 17:29:23 2012] [error] [client 192.168.1.212] Premature end of script headers: status.cgi, referer: http://192.168.1.217
/nagios/side.php
[Mon Jul 16 17:29:28 2012] [error] [client 192.168.1.212] PHP Warning: date(): It is not safe to rely on the system's timezone sett
ings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those
methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing' fo
r 'CST/8.0/no DST' instead in /usr/local/nagios/share/main.php on line 123, referer: http://192.168.1.217/nagios/side.php
[Mon Jul 16 17:29:37 2012] [error] [client 192.168.1.212] PHP Warning: MagpieRSS: Failed to fetch http://www.nagios.org/backend/fee
ds/frontpage/ and cache is off in /usr/local/nagios/share/includes/rss/rss_fetch.inc on line 238, referer: http://192.168.1.217/nagi
os/main.php

 

 

解决方法

 

如果是SELinux处于强制安全模式时需要做

getenforce

 

令SELinux处于容许模式

setenforce 0

 

如果要永久性更变它,需要更改/etc/selinux/config里的设置并重启系统。

 

不关闭SELinux或是永久性变更它的方法是让CGI模块在SELinux下指定强制目标模式:

chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/ chcon -R -t httpd_sys_content_t /usr/local/nagios/share/

你可能感兴趣的:(Permission)