Proposal about initial states for new hosts/services

Ton Voon ton.voon at altinity.com
Wed Jun 18 13:00:54 CEST 2008


Hi!

I want to generate some discussion about this particular proposal  
where new hosts/services are given an initial state, rather than left  
in a PENDING state.

PROBLEM

There is no initial state for hosts and services. This means that the  
NDO database doesn't "know" what the first state is - queries that  
join against the state tables are ignored. Also, the  
nagios_statehistory table doesn't have an initial state making  
querying for reports via the database a lot harder.

This is in Nagios 2.10, but I don't believe there have been changes to  
this in Nagios 3.

POSSIBLE SOLUTION

Nagios, on creating objects and seeing that there is a new object,  
goes through the servicecheck result logic to give an "initial state"  
result, which I propose as being OK for services and UP for hosts.

DISCUSSION

I think Ethan wanted to be more "correct" and say that a new host/ 
service is in a PENDING state because there had never been a result  
received. If you assume a service is OK and the first result is a  
CRITICAL, then there is this period where it looks like there was an  
OK. However, there are inconsistencies and complications to this.  
Complication is that extra logic needs to be placed to cater for  
pending states - we have it in the CGIs and the result logic and lots  
of other places. Similarly, in the state information in NDO, there are  
no entries for new hosts.

There's also inconsistency in the way reports find the first state.  
The reporting CGIs, reads the INITIAL_SERVICE_STATE in the nagios.log.  
In there, for services that have never had a result, it marks it as  
OKAY with "Assumed to be okay". So already there is the concept of an  
Assumed okay result.

What are the downsides? For a new active check, it could be marked as  
okay instead of a failed state, but then the period is relatively  
small. For a passive check, I think it is fair to assume that the  
result is okay until marked otherwise.

Is this a good idea? Is there something I've overlooked?

Ton

http://www.altinity.com
UK: +44 (0)870 787 9243
US: +1 866 879 9184
Fax: +44 (0)845 280 1725
Skype: tonvoon


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php




More information about the Developers mailing list