[Nagios-devel] freshness_threshold bug - big problem

Andreas Ericsson ae at op5.se
Mon Dec 20 17:50:31 UTC 2010


On 12/20/2010 05:52 PM, Rodney Ramos wrote:
> Hi, Jochen,
> 
> Thank you again. I think that you found where the problem is, I mean, the
> base/checks.c::is_host_result_fresh() code.
> 
> I change the lines in the checks.c as below:
> 
> ========================================================
> FROM: Lines 2439 - 2440
> 
>   if(temp_host->freshness_threshold==0)
> 
> freshness_threshold=(temp_host->check_interval*interval_length)+temp_host->latency+additional_freshness_latency;
> 
> TO:
> 
>          if(temp_host->freshness_threshold==0){
>                  if(temp_host->state_type==HARD_STATE ||
> temp_host->current_state==STATE_OK)
> 
> freshness_threshold=(temp_host->check_interval*interval_length)+temp_host->latency+additional_freshness_latency;
>                  else
> 
> freshness_threshold=(temp_host->retry_interval*interval_length)+temp_host->latency+additional_freshness_latency;
>                  }
> ========================================================
> 
> It is working well, as expected. My retry interval is 1 minute and hosts are
> taking about 2 minutes to change SOFT states.
> 
> The logs are:
> 
> BEFORE the changes:
> 
> [1292854105] Warning: The results of host 'host1' are stale by 0d 0h 0m 1s
> (threshold=0d 0h 5m 15s).  I'm forcing an immediate check of the host.
> [1292857824] Warning: The results of host 'host1' are stale by 0d 0h 0m 1s
> (threshold=0d 0h 5m 15s).  I'm forcing an immediate check of the host.
> [1292859117] Warning: The results of host 'host1' are stale by 0d 0h 0m 52s
> (threshold=0d 0h 5m 15s).  I'm forcing an immediate check of the host.
> 
> 
> AFTER the changes:
> 
> [1292859297] Warning: The results of host 'host1' are stale by 0d 0h 0m 59s
> (threshold=0d 0h 1m 38s).  I'm forcing an immediate check of the host.
> [1292859417] Warning: The results of host 'host1' are stale by 0d 0h 0m 31s
> (threshold=0d 0h 1m 22s).  I'm forcing an immediate check of the host.
> [1292859597] Warning: The results of host 'host1' are stale by 0d 0h 0m 47s
> (threshold=0d 0h 1m 44s).  I'm forcing an immediate check of the host.
> 
> So, I´d like to known the developers opinion. It´s a bug or it´s not?

It definitely seems like a bug.

> Are
> you intending to change the source code? If not I will have to change it
> myself always when a new Nagios version is released.
> 

Or you can go with door nr 3 and submit a patch to make the necessary
changes. I won't have time to look into this until god knows when, but I
do have time to apply patches and run some rudimentary tests which, along
with your assertation that it works as per expectations in your network,
should suffice to get it into the first release after I get the patch.

Thanks.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.




More information about the Nagios-devel mailing list