当在Nagios Web页面上访问其对各对象的监控对象信息时, 提示如下错误:

Error: Could not read host and service status information!

The most common cause of this error message (especially for new users), is the fact that Nagios is not actually running. If Nagios is indeed not running, this is a normal error message. It simply indicates that the CGIs could not obtain the current status of hosts and services that are being monitored. If you’ve just installed things, make sure you read the documentation on starting Nagios…..

意思是apache的运行用户要有对文件写的权限. 权限应该设置在目录/usr/local/nagios/var/rw/上,因为每次文件的内容被处理后文件就会被删掉. 处理方法如下:

首先确认Nagios服务是否已经启动.

ps -ef | grep nagios

如果没有启动成功的话,可执行

service nagios start.

确认nagios已成功启动,还是报以上错误信息,再核下,apache的进程,是什么用户运行,一般会是apache

#ps -ef | grep httpd

root 16946 1 0 20:25 ? 00:00:00 /usr/sbin/httpd
apache 16949 16946 0 20:26 ? 00:00:00 /usr/sbin/httpd
apache 16950 16946 0 20:26 ? 00:00:00 /usr/sbin/httpd
apache 16951 16946 0 20:26 ? 00:00:00 /usr/sbin/httpd
apache 16953 16946 0 20:26 ? 00:00:00 /usr/sbin/httpd
apache 16955 16946 0 20:26 ? 00:00:00 /usr/sbin/httpd
apache 16956 16946 0 20:26 ? 00:00:00 /usr/sbin/httpd
apache 16957 16946 0 20:26 ? 00:00:00 /usr/sbin/httpd
apache 16958 16946 0 20:26 ? 00:00:00 /usr/sbin/httpd
root 17083 11266 0 20:31 pts/0 00:00:00 grep http

然后怎么做呢,如果你运行的nagios进程的用户是nagios,
然后创建


mkdir /usr/local/nagios/var/rw

chmod 777 /usr/local/nagios/var/rw

#service nagios restart

#/etc/init.d/httpd restart

如果还不行, 就apache用户登陆, 确认是否可进入该目录, 并测试是否可以在该目录写文件.
如果执行”su – apache”时出现”This account is currently not available”提示, 解决办法:

#cat /etc/passwd | grep apache
apache:x:48:48:Apache:/var/www:/sbin/nologin

发现它的shell是”/sbin/nologin”,改成”/bin/bash”即可
#vipw /etc/passwd

发表评论

电子邮件地址不会被公开。 必填项已用*标注

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


*