SO close- just not there


#1

My nagios is all installed and set up to monitor one host. I can tell the backend is working because I can browse the text version of the log and I see it has ping information and htttp/OK information for the host I set up.

The web interface is set up for the most part also. I can point a browser to the server with nagios and I get the nagios menus. By the way authentication is turned off so the entire world should be open. This is an intranet server and I will slowly lock it down. So CGI authentication should not be a problem.

However when I select any option from the nagios web interface I keep getting “There doesn’t appear to be any service status information in the status log…” … same thing with host status. I can browse the text log in /var/log/nagios and I can plainly see the service/hosts/program sections in the status.log. My config is set up to read this log. I know it sees the log because before the log was under /usr/local/nagios/var and the web interface said that the log file could not be found. I updated the config, moved the log file to /var/log/nagios and now the web interface appears to see the log but just says it cann get any detailed information from it.

I’ve gone through a complete reinstall twice and I am at my wits end.

Any help would be greatly appreciated.


#2

/var/log/ is the linux “system log” directory. YOu should not have moved your /usr/local/nagios/var/status.log file. You should have just corrected the nagios.cfg file to point to the correct directory. Before you start nagios, run this
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg as per the instructions. It will tell you in plain english what is wrong if it finds something funny. Fix what it complained about, and repeat till it’s happy.


#3

btw, you can just delete the status.log and it will recreate it when it makes some checks. Make sure you have nagios.cfg looking for the status.log in /usr/local/nagios/var/status.log


#4

Been through all of this but I will do it again.

Moved the logfile back. Now the browser interface is getting the worse error I mentioned in the last post: “Error: Could not read host and service status information!”. So now it cannot even find the file mentioned in the cfg.

The preflight shows:
Nagios 2.0b1
Copyright © 1999-2005 Ethan Galstad (nagios@nagios.org)
Last Modified: 12-15-2004
License: GPL

Reading configuration data…

Running pre-flight check on configuration data…

Checking services…
Checked 1 services.
Checking hosts…
Checked 1 hosts.
Checking host groups…
Checked 1 host groups.
Checking service groups…
Checked 0 service groups.
Checking contacts…
Checked 1 contacts.
Checking contact groups…
Checked 1 contact groups.
Checking service escalations…
Checked 0 service escalations.
Checking service dependencies…
Checked 0 service dependencies.
Checking host escalations…
Checked 0 host escalations.
Checking host dependencies…
Checked 0 host dependencies.
Checking commands…
Checked 22 commands.
Checking time periods…
Checked 2 time periods.
Checking extended host info definitions…
Checked 0 extended host info definitions.
Checking extended service info definitions…
Checked 0 extended service info definitions.
Checking for circular paths between hosts…
Checking for circular host and service dependencies…
Checking global event handlers…
Checking obsessive compulsive processor commands…
Checking misc settings…

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check


#5

also now when I click on some of the web options I get:

Error: Cannot open log file ‘/var/log/nagios/nagios.log’ for reading!

Even though my config files all point to the dir you said and I restarted nagios.


#6

Do you mean you are getting this “Whoops!
Error: Could not read host and service status information!”, THat means nagios is most likely not running, or if it is running, then the problem is just as it states on that page.
"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.

Some other things you should check in order to resolve this error include:

Check the Nagios log file for messages relating to startup or status data errors.
Always verify configuration options using the -v command-line option before starting or restarting Nagios!
Make sure you’ve compiled the main program and the CGIs to use the same status data storage options (i.e. text file or database). If the main program is storing status data in a text file and the CGIs are trying to read status data from a database, you’ll have problems.

Make sure you read the documentation on installing, configuring and running Nagios thoroughly before continuing"


#7

I suspect this one "Make sure you’ve compiled the main program and the CGIs to use the same status data storage options (i.e. text file or database). If the main program is storing status data in a text file and the CGIs are trying to read status data from a database, you’ll have problems. " so try compiling again, and make sure you config your “cgi.cfg” file the same as you stated when you compiled. ie using mysql or text based storage.


#8

When the CGIs say:
Error: Cannot open log file ‘/var/log/nagios/nagios.log’ for reading!

Where are they getting this setting from?

Nothing in the config files have /var/log in them.


#9

in my nagios.cfg file I have this "log_file=/usr/local/nagios/var/nagios.log"
What do you have in yours? Looks like “log_file=/var/…”

Is this an RPM install of nagios or did you compile it yourself. If it’s RPM, then please uninstall it and compile/install it yourself from source. Pay close attention to how you run ./configure, since that is how nagios is going to be compiled. i.e. with sql support, location of files, etc.
If you did compile it yourself, then you compiled in one way, but are setting up the .cfg files differently. i.e. logfile is not where it is suppose to be compared to how you compiled.
If you did compile yourself, then post the ./configure line in your source code directory from the file ~/nagios-1.2/config.status file into this forum so we can see how you ran ./configure


#10

I compile it myself. I run ./configure with no options and this is what I get out the other end:

Creating sample config files in sample-config/ …

*** Configuration summary for nagios 2.0b1 12-15-2004 ***:

General Options:

    Nagios executable:  nagios
    Nagios user/group:  nagios,nagios
   Command user/group:  nagios,nagios
        Embedded Perl:  no
         Event Broker:  yes
    Install ${prefix}:  /usr/local/nagios
            Lock file:  ${prefix}/var/nagios.lock
       Init directory:  /etc/rc.d/init.d
              Host OS:  linux-gnu

Web Interface Options:

             HTML URL:  [localhost/nagios/](http://localhost/nagios/)
              CGI URL:  [localhost/nagios/cgi-bin/](http://localhost/nagios/cgi-bin/)

Traceroute (used by WAP): /bin/traceroute


#11

Looks good to me, so now what did you put in your /usr/local/nagios/etc/nagios.cfg file for log_file=?


#12

log_file=/usr/local/nagios/var/nagios.log


#13

Then it shouldn’t be complaining about nagios.log in /var, so I suspect that you didn’t actually restart nagios. Maybe a clean reboot will help, that way you know nagios was killed off.


#14

OK, how about your /etc/rc.d/init.d/nagios file? What do you have in it. Mine has this as part of it:

prefix=/usr/local/nagios
exec_prefix=${prefix}
NagiosBin=${exec_prefix}/bin/nagios
NagiosCfg=${prefix}/etc/nagios.cfg
NagiosLog=${prefix}/var/status.log
NagiosTmp=${prefix}/var/nagios.tmp
NagiosSav=${prefix}/var/status.sav
NagiosCmd=${prefix}/var/rw/nagios.cmd
NagiosVar=${prefix}/var
NagiosRun=${prefix}/var/nagios.lock
NagiosLckDir=/var/lock/subsys
NagiosLckFile=nagios
NagiosCGI=${exec_prefix}/sbin
Nagios=nagios

Check that nagios exists.

test -f $NagiosBin || exit 0

Check that nagios.cfg exists.

test -f $NagiosCfg || exit 0

See how we were called.

case “$1” in

    start)
            echo "Starting network monitor: nagios"
            su -l $Nagios -c "touch $NagiosVar/nagios.log $NagiosSav"
            rm -f $NagiosCmd
            $NagiosBin -d $NagiosCfg
            if  -d $NagiosLckDir ]; then touch $NagiosLckDir/$NagiosLckFile; fi
            sleep 1
            status_nagios nagios
            ;;gios=nagios

I’ll bet your’s isn’t like that at all.
Edited Sun Feb 13 2005, 09:52PM ]


#15

Machine rebooted.

Going to web interface now. CLick on Host detail and get.

There doesn’t appear to be any host status information in the status log…

Yet I can look in the status.log and see host and server information for the one host that is setup.

Thanks for all the help - we’ll figure this out eventually.


#16

Also:

From the web interface if you go to the web log I see:
Service Ok[02-13-2005 11:39:54] SERVICE ALERT: cessna;Apache;OK;SOFT;2;HTTP OK HTTP/1.1 200 OK - 2973 bytes in 0.059 seconds
Service Critical[02-13-2005 11:37:14] SERVICE ALERT: cessna;Apache;CRITICAL;SOFT;1;CRITICAL - Socket timeout after 10 seconds
Host Up[02-13-2005 11:37:14] HOST ALERT: cessna;UP;HARD;2;PING WARNING - Packet loss = 88%, RTA = 17.88 ms
Host Up[02-13-2005 11:37:14] HOST ALERT: cessna;UP;SOFT;2;PING WARNING - Packet loss = 88%, RTA = 17.88 ms
Host Down[02-13-2005 11:37:06] HOST ALERT: cessna;DOWN;SOFT;1;CRITICAL - Plugin timed out after 10 seconds

But yet there is nothing under the host link AND when I click on View Config I get nothing for hosts, hostgroups, etc.


#17

When you rebooted, nagios should have started up by itself. It does this by using the /etc/rc.d/init.d/nagios script. I pasted a portion of mine above. I’m sure yours has something about /var/log in it. If so, then I’d start from scratch.
Run ./configure
make
make install
make install-init-scripts, or whatever it really is, and anything else that the directions say to run.
You can keep your .cfg files intact, since an install will not write over any of those.

If your init script is the same as mine, then you need to fix your ~/nagios/etc/*.cfg file’s. YOu have made a mistake in them, since your init script is good(if it is good). You could just delete your .cfg files, and start over by cp’g the samples.
Edited Sun Feb 13 2005, 10:37PM ]


#18

YOu really should tell me what is in your /etc/rc.d/init.d/nagios script. I bet that is where the trouble is.


#19

Rebuit from scratch again. Started up nagios. Now I get:

Error: Could not open CGI config file ‘/etc/nagios/cgi.cfg’ for
reading!

So now it is looking in /etc for config information but I did not change any of the make or install defaults.

Amazing.


#20

Here it is:

prefix=/usr/local/nagios
exec_prefix=${prefix}
NagiosBin=${exec_prefix}/bin/nagios
NagiosCfg=${prefix}/etc/nagios.cfg
NagiosLog=${prefix}/var/status.dat
NagiosTmp=${prefix}/var/nagios.tmp
NagiosSav=${prefix}/var/retention.dat
NagiosCmd=${prefix}/var/rw/nagios.cmd
NagiosVar=${prefix}/var
NagiosRun=${prefix}/var/nagios.lock
NagiosLckDir=/var/lock/subsys
NagiosLckFile=nagios
NagiosCGI=${exec_prefix}/sbin
Nagios=nagios