[icinga-checkins] icinga.org: icinga-core/mfriedrich/core: core: fix freshness_threshold problem in host checks by using check_interval in HARD or OK state , else retry_interval (like service checks) #1331

git at icinga.org git at icinga.org
Wed Jun 15 18:33:55 CEST 2011


Module: icinga-core
Branch: mfriedrich/core
Commit: 33ab149053d9aa4ed38dab45537e02e075d2b875
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=33ab149053d9aa4ed38dab45537e02e075d2b875

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Wed Jun 15 18:00:56 2011 +0200

core: fix freshness_threshold problem in host checks by using check_interval in HARD or OK state, else retry_interval (like service checks) #1331

fixes #1331

---

 Changelog     |    1 +
 base/checks.c |    5 ++++-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/Changelog b/Changelog
index bf97fa4..a5ed675 100644
--- a/Changelog
+++ b/Changelog
@@ -13,6 +13,7 @@ ENHANCEMENTS
 FIXES
 * core: remove duplicated unlinks for check result files with multiple results #1615
 * core: fix retain status file over an init script reload #1579
+* core: fix freshness_threshold problem in host checks by using check_interval in HARD or OK state, else retry_interval (like service checks) #1331
 
 * classic ui: fix cross site scripting vulnerability in config.cgi on config expander arguments #1605
 * classic ui: remove sidebar.html inclusion in index.html causing troubles on reload #1632
diff --git a/base/checks.c b/base/checks.c
index 35af506..4cda0b9 100644
--- a/base/checks.c
+++ b/base/checks.c
@@ -2605,7 +2605,10 @@ int is_host_result_fresh(host *temp_host, time_t current_time, int log_this){
 
 	/* use user-supplied freshness threshold or auto-calculate a freshness threshold to use? */
 	if(temp_host->freshness_threshold==0)
-		freshness_threshold=(temp_host->check_interval*interval_length)+temp_host->latency+additional_freshness_latency;
+                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;
 	else
 		freshness_threshold=temp_host->freshness_threshold;
 





More information about the icinga-checkins mailing list