nagios_statehistory table in ndoutils 1.4b4

Ton Voon ton.voon at altinity.com
Mon Jul 23 12:07:26 CEST 2007


Hi Ethan,

I wanted to find out what your intentions were with the  
nagios_statehistory table, as I think there's a clarification that  
needs to be made and we have a suggestion for enhancement. We're  
happy to provide some patches based on what the design is meant to be.

We are using NDO 1.4b4 and from the DB Model PDF, it describes the  
nagios_statehistory as "used to store a historical record of host and  
service state changes". However, it appears to be storing every non  
OK state, rather than changes.

Also, all rows have state_change=1.

This means we are getting rows (for a single service, with  
max_check_attempts of 3) of:

date 0, ok
date 1, warn (soft)
date 2 , warn (soft)
date 3, warn (hard)
date 4, ok

But state_change=1 for each row. I would certainly expect date 2 to  
have state_change=0. Should state_change=1 only occur when the  
prior_state != current_state? Or maybe there should be a  
soft_state_change and a hard_state_change column?

For the enhancement, we'd like to add two new columns to each row,  
prior_state and prior_hard_state. The idea is that this holds the  
previous state of a given object, which means that when you run a  
query for an availability report, you do not have to do the "tracking  
back to find initial state" as each row already has that data, which  
will make querying much faster. I believe this will be simple to  
implement at NDOutils because Nagios already has that information  
(though the broker interface will need to be updated).

Ton

http://www.altinity.com
T: +44 (0)870 787 9243
F: +44 (0)845 280 1725
Skype: tonvoon



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/




More information about the Developers mailing list