[icinga-checkins] icinga.org: icinga2/master: Bugfix: Don' t use check interval offsets for services with a check_interval smaller than 1 second .

git at icinga.org git at icinga.org
Fri Feb 8 10:29:43 CET 2013


Module: icinga2
Branch: master
Commit: 10cc9bb1a32981306427e6aeefc625b8b68754bd
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=10cc9bb1a32981306427e6aeefc625b8b68754bd

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Fri Feb  8 10:29:17 2013 +0100

Bugfix: Don't use check interval offsets for services with a check_interval smaller than 1 second.

---

 lib/icinga/service.cpp |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/icinga/service.cpp b/lib/icinga/service.cpp
index 822077d..c1df7b4 100644
--- a/lib/icinga/service.cpp
+++ b/lib/icinga/service.cpp
@@ -284,8 +284,13 @@ void Service::UpdateNextCheck(void)
 	else
 		interval = GetCheckInterval();
 
-	double now = Utility::GetTime();
-	double adj = fmod(now + GetSchedulingOffset(), interval);
+	double adj = 0;
+
+	if (interval > 1)
+		double now = Utility::GetTime();
+		adj = fmod(now + GetSchedulingOffset(), interval);
+	}
+
 	SetNextCheck(now - adj + interval);
 }
 





More information about the icinga-checkins mailing list