Services check and unreachable host status

Gabes Jean j.gabes at lectra.com
Thu Sep 27 15:11:36 CEST 2007



-----Message d'origine-----
De : nagios-devel-bounces at lists.sourceforge.net 
À : Nagios Developers List
Objet : Re: [Nagios-devel] Services check and unreachable host status

>>> That's an option, ofcourse, but it sounds to me as if you really should
>>> be patching the GUI files to hide services that are on hosts that are
>>> down. That way you should get what you want while maintaining report
>>> correctness.
> 
> Yes, but I prefer modify some C lines than PHP :)

>>The web-interface is written in C, so it'd be the same there.

I wrote the little hack in the code:
/base/check.c, line 1115:

/* Ugly hack for service in a UNKNOWN state for UNREACHABLE host */
if(temp_host->current_state==HOST_UNREACHABLE){
    temp_service->current_state = STATE_UNKNOWN;
    temp_service->state_type = HARD_STATE;
}


That's all :)

If the service check is done before the host is declared down, it raises a critical error. I'll add a loop for checking the parents, like in the host check.
Then testing for usage and see how modify the interface ;)


Jean


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/




More information about the Developers mailing list