mirror of https://github.com/Icinga/icinga2.git
parent
04061adc01
commit
d8c9d6a88a
|
@ -42,12 +42,15 @@ double Service::GetFlappingCurrent(void) const
|
|||
|
||||
bool Service::GetEnableFlapping(void) const
|
||||
{
|
||||
return GetEnableFlappingRaw();
|
||||
if (!GetOverrideEnableFlapping().IsEmpty())
|
||||
return GetOverrideEnableFlapping();
|
||||
else
|
||||
return GetEnableFlappingRaw();
|
||||
}
|
||||
|
||||
void Service::SetEnableFlapping(bool enabled, const String& authority)
|
||||
{
|
||||
SetEnableFlappingRaw(enabled);
|
||||
SetOverrideEnableFlapping(enabled);
|
||||
|
||||
OnFlappingChanged(GetSelf(), enabled ? FlappingEnabled : FlappingDisabled);
|
||||
OnEnableFlappingChanged(GetSelf(), enabled, authority);
|
||||
|
|
|
@ -166,7 +166,7 @@ bool Service::GetEnableNotifications(void) const
|
|||
if (!GetOverrideEnableNotifications().IsEmpty())
|
||||
return GetOverrideEnableNotifications();
|
||||
else
|
||||
return GetEnableNotifications();
|
||||
return GetEnableNotificationsRaw();
|
||||
}
|
||||
|
||||
void Service::SetEnableNotifications(bool enabled, const String& authority)
|
||||
|
|
|
@ -273,6 +273,9 @@ int Service::GetModifiedAttributes(void) const
|
|||
if (!GetOverrideEnablePassiveChecks().IsEmpty())
|
||||
attrs |= ModAttrPassiveChecksEnabled;
|
||||
|
||||
if (!GetOverrideEnableFlapping().IsEmpty())
|
||||
attrs |= ModAttrFlapDetectionEnabled;
|
||||
|
||||
if (!GetOverrideEnableEventHandler().IsEmpty())
|
||||
attrs |= ModAttrEventHandlerEnabled;
|
||||
|
||||
|
@ -298,6 +301,9 @@ void Service::SetModifiedAttributes(int flags)
|
|||
if ((flags & ModAttrPassiveChecksEnabled) == 0)
|
||||
SetOverrideEnablePassiveChecks(Empty);
|
||||
|
||||
if ((flags & ModAttrFlapDetectionEnabled) == 0)
|
||||
SetOverrideEnableFlapping(Empty);
|
||||
|
||||
if ((flags & ModAttrEventHandlerEnabled) == 0)
|
||||
SetOverrideEnableEventHandler(Empty);
|
||||
|
||||
|
|
|
@ -71,6 +71,9 @@ class Service : DynamicObject
|
|||
[config] bool enable_notifications (EnableNotificationsRaw) {
|
||||
default {{{ return true; }}}
|
||||
};
|
||||
[config] bool enable_flapping (EnableFlappingRaw) {
|
||||
default {{{ return true; }}}
|
||||
};
|
||||
|
||||
[state] double next_check (NextCheckRaw);
|
||||
[state] int check_attempt {
|
||||
|
@ -122,15 +125,13 @@ class Service : DynamicObject
|
|||
[state] int flapping_positive;
|
||||
[state] int flapping_negative;
|
||||
[state] double flapping_last_change;
|
||||
[state] bool enable_flapping (EnableFlappingRaw) {
|
||||
default {{{ return true; }}}
|
||||
};
|
||||
[state] bool enable_perfdata {
|
||||
default {{{ return true; }}}
|
||||
};
|
||||
[state] Value override_enable_notifications;
|
||||
[state] Value override_enable_active_checks;
|
||||
[state] Value override_enable_passive_checks;
|
||||
[state] Value override_enable_flapping;
|
||||
[state] Value override_check_interval;
|
||||
[state] Value override_retry_interval;
|
||||
[state] Value override_enable_event_handler;
|
||||
|
|
Loading…
Reference in New Issue