Historical Tables vs Current Status Tables
Historical Tables vs Current Status Tables
In the Nagios database, the historical data is stored in nagios_servicechecks and nagios_hostchecks tables and the current status is store in nagios_hoststatus and nagios_servicestatus tables. It looks to me that the current status is inserted into the current status tables and the historical tables at the same time. Are there any benefits to query the current status tables?
-
tonyyarusso
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: Historical Tables vs Current Status Tables
As opposed to pulling the most recent record from the historical table you mean? Performance, as the SQL query for sorting and pulling the last one from a potentially very large table will never be as fast as pulling the single record directly from a small table.
Re: Historical Tables vs Current Status Tables
Thanks for your answer! In our case, we need to query the historical tables anyway since we want to retrieve all the status from a previous timestamp until the cureent time. If the result of querying the historical tables already includes the current status, we do not need to do a second query into the current status tables. Is that correct?
-
tonyyarusso
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: Historical Tables vs Current Status Tables
I believe so, yes.
Re: Historical Tables vs Current Status Tables
How long will the data be kept in the historical tables? Is there any way to configure it? It looks to me that by defautl they are purged quite frequently.
Re: Historical Tables vs Current Status Tables
The newest release 1.4b has a page Admin->Performance settings where you can now specify the ages of your table data.