[icinga-checkins] icinga.org: icinga-core/r1.4: 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
Mon Jun 20 19:22:24 CEST 2011


Module: icinga-core
Branch: r1.4
Commit: 0e4605c79ff7511f0b248de2abda7f53445ae865
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=0e4605c79ff7511f0b248de2abda7f53445ae865

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 219d591..93cfbe7 100644
--- a/Changelog
+++ b/Changelog
@@ -21,6 +21,7 @@ ENHANCEMENTS
 
 FIXES
 * 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: better handling of writing to cgi.log in cmd.cgi #1161
diff --git a/base/checks.c b/base/checks.c
index 30e44b5..d0bcb65 100644
--- a/base/checks.c
+++ b/base/checks.c
@@ -2615,7 +2615,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