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/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值