[icinga-checkins] icinga.org: icinga2/master: Reschedule service when check interval is changed.

git at icinga.org git at icinga.org
Mon Feb 11 16:11:25 CET 2013


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

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Mon Feb 11 16:11:11 2013 +0100

Reschedule service when check interval is changed.

Fixes #3681

---

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

diff --git a/lib/icinga/service.cpp b/lib/icinga/service.cpp
index 78bbb60..ba3fa5e 100644
--- a/lib/icinga/service.cpp
+++ b/lib/icinga/service.cpp
@@ -221,6 +221,13 @@ void Service::OnAttributeChanged(const String& name, const Value& oldValue)
 		Service::InvalidateCommentCache();
 	else if (name == "notifications")
 		UpdateSlaveNotifications();
+	else if (name == "check_interval") {
+		ConfigItem::Ptr item = ConfigItem::GetObject("Service", GetName());
+
+		/* update the next check timestamp if we're the owner of this service */
+		if (item && !IsAbstract())
+			UpdateNextCheck();
+	}
 }
 
 set<Host::Ptr> Service::GetParentHosts(void) const





More information about the icinga-checkins mailing list