Hey guys. Looks like I have something set up wrong.
I have noticed that the nagios web interface seems to be caching old information. I have disabled proxies and force refresh with shift. The same behaviour occurs in IE and Firefox.
Here is a series of refreshes for a host.
Last status check 13:21 13:25 13:25 13:26 13:30 13:31 13:32
Last stage change 13:10 13:05 13:10 13:05 13:10 13:10 13:05
Last host notificat 13:10 n/a 13:10 n/a 13:10 13:10 13:05
The status check time seems correct, and i believe the records where the host notifications are n/a are correct. Where are the other records coming from?
I’m not sure what you are looking at, perhaps a link would help. But one thing you might not realize, is that host’s are never checked unless a service_check fails, in version 1.2 and earlier.
It is the same for services. For example
/nagios/cgi-bin/extinfo.cgi?type=2&host=apchndc01&service=Ping
Basically I have been playing with "Disable notifications for this service"
Initially the notifications are disabled.
I hit disable notifications.
I hit force-refresh until after ten seconds or so, notifications are disabled.
I continue to hit force-refresh every minute, but almost every time it flaps between showing information prior to the notifications change and after.
I don’t believe the problem is anything to do with notifications however, it just makes the problem clearer. I can do this for any page in the nagios web interface and watch the information cycle.
Where could nagios be caching the old information?
The status is kept in files or a mysql database, depending on how you compiled it. It almost sounds like a browser problem, rather than a nagios problem. I don’t see how nagios could be reporting old data to you, but yet, the previous minute, the data was fresh. Sorry, but I’m at a loss.
I wonder why you don’t get the entire line, as i do above.
How do you start nagios anyway?
Mine is started in /etc/rc.d/init.d/nagios, which starts the daemon with command that you see above.
anyhow, if you have done /etc/rc.d/init.d/nagios stop, then you should no longer see any nagios procs running.
and yes, there will be many of them running at times, since you most likely have nagios.cfg with this in it:
MAXIMUM CONCURRENT SERVICE CHECKS
This option allows you to specify the maximum number of
service checks that can be run in parallel at any given time.
Specifying a value of 1 for this variable essentially prevents
any service checks from being parallelized. A value of 0
will not restrict the number of concurrent checks that are
I figured out why the init.d/nagios script was failing.
For some reason as you also picked up, in the process list it does not show the process as /usr/sbin/nagios but as [nagios]
The check_nagios plugin always failed so it assumed it was running.
In the init.d script, i changed the /usr/sbin/nagios to [nagios] and then it started working properly.
But why is the process shown as [nagios] ???
It is debian (mainly stable, but some testing branch) and a 2.4.18 debian kernel.
Below is the portion of the init.d script that was causing the problem.
check_started () {
if -f /etc/nagios/check_nagios_db ]; then
if ! /etc/nagios/check_nagios_db > /dev/null; then
return 1 # isn’t started
fi
elif -f /usr/lib/nagios/plugins/check_nagios ]; then
if ! /usr/lib/nagios/plugins/check_nagios -e 15 -F /var/log/nagios/status.log -C ‘/usr/sbin/nagios’ > /dev/null; then
return 1 # isn’t started
fi
fi
if -f $PIDFILE ]; then
pid=cat $PIDFILE
if “$pid” ] && ps $pid >/dev/null; then
return 0 # Is started
fi
fi
return 1 # Isn’t started
}
Here is the full ps. As you can see, there are other processes which have the same [format]. They are all system daemons.
Under the -f option, ps tries to determine the command name and arguments given when the process was created by examining the user block. Failing this, the command name is printed, as it would have appeared without the -f option, in square brackets.
I upgraded the debian kernel from 2.4.18 -> 2.4.27 and then the nagios process displayed properly under ps. I put back the original init.d script and now it works sweet!