Re: [Nagios-devel] freshness_threshold bug - big problem
Posted: Mon Dec 20, 2010 4:52 pm
--000e0ce00ad87acc3d0497da59f1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
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:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D
FROM: Lines 2439 - 2440
if(temp_host->freshness_threshold=3D=3D0)
freshness_threshold=3D(temp_host->check_interval*interval_length)+temp_host=
->latency+additional_freshness_latency;
TO:
if(temp_host->freshness_threshold=3D=3D0){
if(temp_host->state_type=3D=3DHARD_STATE ||
temp_host->current_state=3D=3DSTATE_OK)
freshness_threshold=3D(temp_host->check_interval*interval_length)+temp_host=
->latency+additional_freshness_latency;
else
freshness_threshold=3D(temp_host->retry_interval*interval_length)+temp_host=
->latency+additional_freshness_latency;
}
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D
It is working well, as expected. My retry interval is 1 minute and hosts ar=
e
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=3D0d 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=3D0d 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=3D0d 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=3D0d 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=3D0d 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=3D0d 0h 1m 44s). I'm forcing an immediate check of the host.
So, I=B4d like to known the developers opinion. It=B4s a bug or it=B4s not?=
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.
Thanks a lot,
Rodney.
On Fri, Dec 17, 2010 at 10:07 AM, Jochen Bern wrot=
e:
> On 12/17/2010 12:10 PM, Rodney Ramos wrote:
> > Than I understood that you confirm the problem
>
> I confirm that my 3.2.3 autodetermines the host's freshness threshold as
> check_interval+additional_freshness_latency, even in SOFT non-OK cases,
> when active checks would use retry_interval instead.
>
> I'm not calling it a "problem" yet, though, because the specifics you
> quote (apparently from a local copy of the docs ?) are absent from the
> docs at http://nagios.sourceforge.net/docs/3_0/freshness.html .
>
> Nonetheless, when I compare base/checks.c::is_host_result_fresh() to
> base/checks.c::is_service_result_fresh(), it seems that the latter
> *does* do the if-then-else you describe, while it's absent from the forme=
r:
>
> [...]
> /* tests whether or not a service's check results are fresh */
> int is_service_result_fresh(service *temp_service, time_t current_time,
> int log_this){
> [...]
> /* use user-supplied freshness threshold or auto-calculate a
> freshness threshold to use? */
> if(temp_service->freshness_threshold=3D=3D0){
> if(temp_service->state_type=3D=3DHARD_STATE ||
> temp_service->current_state=3D=3DSTATE_OK)
>
>
> freshness_threshold=3D(temp_service->check_interval*interval_length)+temp=
_service->latency+additional_freshness_latency;
> else
>
>
> freshness_threshold=3D(temp_service->retry_interval*interval_length)+temp=
_service->latency+additional_freshness_latency;
> }
> else
> freshness_threshold=3Dtemp_service->freshness
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
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:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D
FROM: Lines 2439 - 2440
if(temp_host->freshness_threshold=3D=3D0)
freshness_threshold=3D(temp_host->check_interval*interval_length)+temp_host=
->latency+additional_freshness_latency;
TO:
if(temp_host->freshness_threshold=3D=3D0){
if(temp_host->state_type=3D=3DHARD_STATE ||
temp_host->current_state=3D=3DSTATE_OK)
freshness_threshold=3D(temp_host->check_interval*interval_length)+temp_host=
->latency+additional_freshness_latency;
else
freshness_threshold=3D(temp_host->retry_interval*interval_length)+temp_host=
->latency+additional_freshness_latency;
}
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D
It is working well, as expected. My retry interval is 1 minute and hosts ar=
e
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=3D0d 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=3D0d 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=3D0d 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=3D0d 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=3D0d 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=3D0d 0h 1m 44s). I'm forcing an immediate check of the host.
So, I=B4d like to known the developers opinion. It=B4s a bug or it=B4s not?=
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.
Thanks a lot,
Rodney.
On Fri, Dec 17, 2010 at 10:07 AM, Jochen Bern wrot=
e:
> On 12/17/2010 12:10 PM, Rodney Ramos wrote:
> > Than I understood that you confirm the problem
>
> I confirm that my 3.2.3 autodetermines the host's freshness threshold as
> check_interval+additional_freshness_latency, even in SOFT non-OK cases,
> when active checks would use retry_interval instead.
>
> I'm not calling it a "problem" yet, though, because the specifics you
> quote (apparently from a local copy of the docs ?) are absent from the
> docs at http://nagios.sourceforge.net/docs/3_0/freshness.html .
>
> Nonetheless, when I compare base/checks.c::is_host_result_fresh() to
> base/checks.c::is_service_result_fresh(), it seems that the latter
> *does* do the if-then-else you describe, while it's absent from the forme=
r:
>
> [...]
> /* tests whether or not a service's check results are fresh */
> int is_service_result_fresh(service *temp_service, time_t current_time,
> int log_this){
> [...]
> /* use user-supplied freshness threshold or auto-calculate a
> freshness threshold to use? */
> if(temp_service->freshness_threshold=3D=3D0){
> if(temp_service->state_type=3D=3DHARD_STATE ||
> temp_service->current_state=3D=3DSTATE_OK)
>
>
> freshness_threshold=3D(temp_service->check_interval*interval_length)+temp=
_service->latency+additional_freshness_latency;
> else
>
>
> freshness_threshold=3D(temp_service->retry_interval*interval_length)+temp=
_service->latency+additional_freshness_latency;
> }
> else
> freshness_threshold=3Dtemp_service->freshness
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]