Error: Could not read host and service status information!

I get this error whenever I try to access the reports in the UI. Configuration files have been validated and nagios is running. I have also made sure owner/group/permissions have been set properly for the nagios directory and all files and subdirectories.

I have looked at the logs and cannot find any errors. Any suggestions on what else I can look at to determine what is causing the problem? Thanks for any pointers.

That error indicates nagios is not running. Do a ps -ef|grep nagios and make sure that all nagios is dead by killing them. Then start nagios, /etc/rc.d/init.d/nagios start and paste your ps-ef|grep nagios here.

Then if you have more trouble, perhaps this is another SElinux problem, so turn off selinux.

Here is the ps command output:

nagios 625 1 0 Mar 18 ? 0:40 /usr/local/nagios/sbin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
nagios 6270 1 0 14:37:21 ? 0:00 /usr/local/nagios/bin/nagios -d /etc/nagios/nagios.cfg

This is after a restart.

To note, this is also running on Solaris 9.

To make sure the apache configuration is working correctly, I put a perl script in the ./nagios/sbin directory (which the URL of ./nagios/cgi-bin points to) and that works fine.

I also have authorization (via .htaccess in ./nagios/sbin) set up so when I try to execute anything using the URL ./nagios/cgi-bin it asks for a valid userid and password, and that works fine as well.

However, I have set use_authentication=0 in cgi.cfg because setting it to 1 causes errors during the monitoring process. I don’t think this would cause problems with the UI, but I thought I’d mention it anyway.

I don’t believe the {gd,zlib,libpng,jpeg} libs are installed on this system (I didn’t build this mess). Could this be the problem? I would think at least one of the monitoring tools (e.g. Tactical Overview) would work without them…then again, I would think that there would be a different error than the one in the topic if this were the case…

I found the problem by attempting to look at the event log where it complained it did not have permission to read /var/log/nagios/nagios.log.

The permission which had the problem was on the directory /var/log/nagios which had world read access only: drwxrwxr–

As soon as I did a chmod 0775 to it (drwxrwxr-:evil: to allow execute as well, the UI started working.

Why does the nagios UI (i.e. cgi programs) need execute access to the log directory? This seems excessive and made it difficult to troubleshoot this problem. If this is a requirement for the UI to work, it should at least be documented.
Edited Thu Jul 07 2005, 12:36PM ]

if i remember right all nagios directories should be accessible to the nagios group which contains the nagios user and the user as which the web server is running… as written in the docs in the installing nagios section.

Luca

Setting specific permissions on directories is not mentioned anywhere in the documentation. In addition, nagios doesn’t need execute access to read the nagios.log file, but this is what I had to grant to get the UI to work.

permissions on the directories are set when you compile and make install. It looks as though yours is an RPM, so blame it on who made the RPM for you.
Nagios user does need execute permissions on the directory that holds the log file. Check your directory persmissions.
ls -la /usr/local/nagios/
total 72
drwxr-xr-x 9 root root 4096 Jun 27 13:27 .
drwxr-xr-x 16 root root 4096 Jun 25 13:59 …
drwxrwxr-x 2 nagios nagios 4096 Jun 30 16:58 bin
drwxrwxr-x 2 nagios nagios 4096 Jun 30 16:55 etc
drwxr-xr-x 2 nagios nagios 4096 Jun 27 13:10 libexec
drwxr-xr-x 4 root root 4096 Jun 27 13:26 nagiostat
drwxrwxr-x 2 nagios nagios 4096 Jun 27 16:06 sbin
drwxrwxr-x 9 nagios nagios 4096 Jun 27 15:19 share
drwxrwxr-x 4 nagios nagios 4096 Jul 8 00:00 var

Notice the var directory has nagios.nagios and 775. That is where the log file is created.