From: Gunnar Beutner Date: Mon, 11 Feb 2013 15:11:11 +0000 (+0100) Subject: Reschedule service when check interval is changed. X-Git-Tag: v0.0.2~448 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8ab803aac017c05e38342c938c61f4de809e9e0c;p=icinga2 Reschedule service when check interval is changed. Fixes #3681 --- diff --git a/lib/icinga/service.cpp b/lib/icinga/service.cpp index 78bbb6000..ba3fa5ef5 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 Service::GetParentHosts(void) const