Nagios图形显示pnp4nagios访问出错解决
问题描述:安装pnp4nagios后访问图形提示“Object not found”页面
软件版本:
suse linux sles 10sp2 x86_64
nagios 3.2.0
pnp4nagios-0.6.2
apache2 2.2.3
问题解决:
step1,直接访问http://<ipaddress>/pnp4nagios/,pnp4nagios给出一个测试结果界面,提示“Apache mod_rewrite is not enabled”,怀疑是apache2的rewrite module没有启用;
step2,查看apache2的loadmodule配置
# vi /etc/sysconfig/apache2
在APACHE_MODULES加入rewrite选项
APACHE_MODULES="apparmor actions alias auth_basic authn_file authz_host authz_groupfile authz_default authz_user authn_dbm autoindex cgi dir env expires include log_config mime negotiation setenvif ssl suexec userdir php5 rewrite"
step3,重启apache2
service apache2 restart
查看/etc/apache2/sysconfig.d/loadmodule.conf发现rewrite_module已经加入
LoadModule rewrite_module /usr/lib64/apache2-prefork/mod_rewrite.so
step4,再次访问http://<ipaddress>/pnp4nagios/
Apache Rewrite Module Pass
step5,修改pnp4nagios下install.php文件名
mv /usr/local/pnp4nagios/share/install.php /usr/local/pnp4nagios/share/install.php.bk
step6,再次访问图像界面,又提示
pnp error
An error was detected which prevented the loading of this page. If this problem persists, please contact the website administrator.
/usr/local/pnp4nagios/lib/kohana/system/libraries/Session.php :
session_start(): open(/var/lib/php5/sess_d1suf0cpph46v95efp1b7l0cbtt0q7nr, O_RDWR) failed: Permission denied (13)
step7,检查 /var/lib/php5 目录的权限,发现原来是root才可以读写,而apache2采用了nagios的用户来运行,所以php的session数据没有权限写入,于是更改/var/lib/php5的写入权限
chown -R 777 /var/lib/php5
修改后pnp4nagios图形终于访问正常。
页:
[1]