diff --git a/lib/icinga/checkable.cpp b/lib/icinga/checkable.cpp index 8ce79afc4..9fe9b81f4 100644 --- a/lib/icinga/checkable.cpp +++ b/lib/icinga/checkable.cpp @@ -215,25 +215,35 @@ int Checkable::GetModifiedAttributes(void) const return attrs; } -void Checkable::SetModifiedAttributes(int flags) +void Checkable::SetModifiedAttributes(int flags, const MessageOrigin& origin) { - if ((flags & ModAttrNotificationsEnabled) == 0) + if ((flags & ModAttrNotificationsEnabled) == 0) { SetOverrideEnableNotifications(Empty); + OnEnableNotificationsChanged(GetSelf(), GetEnableNotifications(), origin); + } - if ((flags & ModAttrActiveChecksEnabled) == 0) + if ((flags & ModAttrActiveChecksEnabled) == 0) { SetOverrideEnableActiveChecks(Empty); + OnEnableActiveChecksChanged(GetSelf(), GetEnableActiveChecks(), origin); + } - if ((flags & ModAttrPassiveChecksEnabled) == 0) + if ((flags & ModAttrPassiveChecksEnabled) == 0) { SetOverrideEnablePassiveChecks(Empty); + OnEnablePassiveChecksChanged(GetSelf(), GetEnablePassiveChecks(), origin); + } - if ((flags & ModAttrFlapDetectionEnabled) == 0) + if ((flags & ModAttrFlapDetectionEnabled) == 0) { SetOverrideEnableFlapping(Empty); + OnEnableFlappingChanged(GetSelf(), GetEnableFlapping(), origin); + } if ((flags & ModAttrEventHandlerEnabled) == 0) SetOverrideEnableEventHandler(Empty); - if ((flags & ModAttrPerformanceDataEnabled) == 0) + if ((flags & ModAttrPerformanceDataEnabled) == 0) { SetOverrideEnablePerfdata(Empty); + OnEnablePerfdataChanged(GetSelf(), GetEnablePerfdata(), origin); + } if ((flags & ModAttrNormalCheckInterval) == 0) SetOverrideCheckInterval(Empty); diff --git a/lib/icinga/checkable.h b/lib/icinga/checkable.h index 9fc21fc74..71205d465 100644 --- a/lib/icinga/checkable.h +++ b/lib/icinga/checkable.h @@ -143,7 +143,7 @@ public: void ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrigin& origin = MessageOrigin()); int GetModifiedAttributes(void) const; - void SetModifiedAttributes(int flags); + void SetModifiedAttributes(int flags, const MessageOrigin& origin = MessageOrigin()); bool IsCheckPending(void) const; diff --git a/lib/icinga/command.cpp b/lib/icinga/command.cpp index ffbf0dfa0..5f990bc51 100644 --- a/lib/icinga/command.cpp +++ b/lib/icinga/command.cpp @@ -45,7 +45,7 @@ int Command::GetModifiedAttributes(void) const return attrs; } -void Command::SetModifiedAttributes(int flags) +void Command::SetModifiedAttributes(int flags, const MessageOrigin& origin) { if ((flags & ModAttrCustomVariable) == 0) { SetOverrideVars(Empty); diff --git a/lib/icinga/command.h b/lib/icinga/command.h index a41c74d12..fdc19e9b4 100644 --- a/lib/icinga/command.h +++ b/lib/icinga/command.h @@ -25,6 +25,7 @@ #include "base/i2-base.h" #include "base/array.h" #include "base/logger_fwd.h" +#include "remote/messageorigin.h" #include namespace icinga @@ -45,7 +46,7 @@ public: virtual bool ResolveMacro(const String& macro, const CheckResult::Ptr& cr, String *result) const; int GetModifiedAttributes(void) const; - void SetModifiedAttributes(int flags); + void SetModifiedAttributes(int flags, const MessageOrigin& origin = MessageOrigin()); }; } diff --git a/lib/icinga/user.cpp b/lib/icinga/user.cpp index 36a4590aa..9fa1c1eaf 100644 --- a/lib/icinga/user.cpp +++ b/lib/icinga/user.cpp @@ -118,7 +118,7 @@ int User::GetModifiedAttributes(void) const return attrs; } -void User::SetModifiedAttributes(int flags) +void User::SetModifiedAttributes(int flags, const MessageOrigin& origin) { if ((flags & ModAttrCustomVariable) == 0) { SetOverrideVars(Empty); diff --git a/lib/icinga/user.h b/lib/icinga/user.h index 780cd979f..4dc8b1568 100644 --- a/lib/icinga/user.h +++ b/lib/icinga/user.h @@ -25,6 +25,7 @@ #include "icinga/macroresolver.h" #include "icinga/timeperiod.h" #include "base/array.h" +#include "remote/messageorigin.h" namespace icinga { @@ -48,7 +49,7 @@ public: static void ValidateFilters(const String& location, const Dictionary::Ptr& attrs); int GetModifiedAttributes(void) const; - void SetModifiedAttributes(int flags); + void SetModifiedAttributes(int flags, const MessageOrigin& origin = MessageOrigin()); protected: virtual void Stop(void);