Nagios Statistics

Marc Powell marc at ena.com
Thu Dec 4 17:25:31 CET 2003



> -----Original Message-----
> From: Daniel Henninger [mailto:daniel at unity.ncsu.edu]
> Sent: Thursday, December 04, 2003 8:37 AM
> To: Marc Powell
> Cc: nagios-devel at lists.sourceforge.net
> Subject: Re: [Nagios-devel] Nagios Statistics
> 
> > This information comes from the log files, not the database
(nagios.log
> > and the archives). You would need to remove every log entry for the
host
> > in question. It could probably be done fairly easily with a perl or
sed
> > script but there's no built in facility in nagios.
> >
> > If you changed the name of the host that would have the same effect.
> 
> Then what are the database entries time_ok, time_warning,
time_critical,
> and time_unknown for exactly?  Are they regularly calculated from the
logs
> or something?  (or on startup?)  I write a lot of external interfaces
to
> nagios's database, which access mysql directly.  I pulled those fields
> from there.  They seem to be nice and accurate.  ;)  But they are
accurate
> since the "dawn of time" for that host.  I was under the impression
that
> those servicestatus table entries (time_ok, etc) were kept up
separately
> from the logs.

I can't answer that actually but I don't think that I would trust it.
Looking at avail.c (and not being a programmer), this is where the
actual availability data looks to be calculated and displayed --

                       /* create list of subjects to collect
availability data for */
                        create_subject_list();

                        /* read in all necessary archived state data */
                        read_archived_state_data();

                        /* compute availability data */
                        compute_availability();

                        time(&report_end_time);

                        if(output_format==HTML_OUTPUT){

The subroutine read_archived_state_data() definitely walks through the
archived log files and not the database.


I'm going to guess that the numbers in the database are dumped
periodically from memory and are only accurate because you've had
retain_state_information enabled from the beginning. You could change
them by shutting down nagios, resetting the numbers in the DB, then
restarting Nagios but it will have no bearing on the numbers presented
if you run avail.cgi.

--
Marc


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/




More information about the Developers mailing list