RE: [Nagios-devel] Nagios Statistics
Posted: Thu Dec 04, 2003 8:25 am
> -----Original Message-----
> From: Daniel Henninger [mailto:[email protected]]
> Sent: Thursday, December 04, 2003 8:37 AM
> To: Marc Powell
> Cc: [email protected]
> Subject: Re: [Nagios-devel] Nagios Statistics
>=20
> > 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.
>=20
> 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.
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=3D=3DHTML_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 post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]