From: Michael Friedrich Date: Sat, 3 May 2014 17:53:16 +0000 (+0200) Subject: Rename Dependency 'state_filter' to 'states'. X-Git-Tag: v0.0.11~92 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0691d73af92ec76c53bd02b17e7fd996d88f5a1b;p=icinga2 Rename Dependency 'state_filter' to 'states'. Fixes #6113 --- diff --git a/doc/4.3-object-types.md b/doc/4.3-object-types.md index ac79ed10f..e45f10e24 100644 --- a/doc/4.3-object-types.md +++ b/doc/4.3-object-types.md @@ -209,7 +209,7 @@ Example: parent_host_name = "internet" parent_service_name = "ping4" - state_filter = [ OK, Warning ] + states = [ OK, Warning ] disable_checks = true } @@ -225,7 +225,7 @@ Attributes: disable_checks |**Optional.** Whether to disable checks when this dependency fails. Defaults to false. disable_notifications|**Optional.** Whether to disable notifications when this dependency fails. Defaults to true. period |**Optional.** Time period during which this dependency is enabled. - state_filter |**Optional.** A list of state filters when this dependency should be OK. Defaults to [ OK, Warning ] for services and [ Up ] for hosts. + states |**Optional.** A list of state filters when this dependency should be OK. Defaults to [ OK, Warning ] for services and [ Up ] for hosts. Available state filters: diff --git a/lib/icinga/icinga-type.conf b/lib/icinga/icinga-type.conf index 253acdc94..0f00ac1cc 100644 --- a/lib/icinga/icinga-type.conf +++ b/lib/icinga/icinga-type.conf @@ -275,7 +275,7 @@ %attribute %name(TimePeriod) "period", - %attribute %array "state_filter" { + %attribute %array "states" { %attribute %number "*" }, %attribute %number "disable_checks", diff --git a/lib/icinga/notification.cpp b/lib/icinga/notification.cpp index 1e1cb78cf..a85f4a4c8 100644 --- a/lib/icinga/notification.cpp +++ b/lib/icinga/notification.cpp @@ -438,7 +438,7 @@ int icinga::FilterArrayToInt(const Array::Ptr& typeFilters, int defaultValue) void Notification::ValidateFilters(const String& location, const Dictionary::Ptr& attrs) { - int sfilter = FilterArrayToInt(attrs->Get("notification_state_filter"), 0); + int sfilter = FilterArrayToInt(attrs->Get("states"), 0); if (!attrs->Contains("service_name") && (sfilter & ~(StateFilterUp | StateFilterDown)) != 0) { ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " + @@ -450,7 +450,7 @@ void Notification::ValidateFilters(const String& location, const Dictionary::Ptr location + ": State filter is invalid."); } - int tfilter = FilterArrayToInt(attrs->Get("notification_type_filter"), 0); + int tfilter = FilterArrayToInt(attrs->Get("types"), 0); if ((tfilter & ~(1 << NotificationDowntimeStart | 1 << NotificationDowntimeEnd | 1 << NotificationDowntimeRemoved | 1 << NotificationCustom | 1 << NotificationAcknowledgement | 1 << NotificationProblem | 1 << NotificationRecovery | diff --git a/lib/icinga/user.cpp b/lib/icinga/user.cpp index 71ab946b8..36a4590aa 100644 --- a/lib/icinga/user.cpp +++ b/lib/icinga/user.cpp @@ -91,14 +91,14 @@ TimePeriod::Ptr User::GetPeriod(void) const void User::ValidateFilters(const String& location, const Dictionary::Ptr& attrs) { - int sfilter = FilterArrayToInt(attrs->Get("notification_state_filter"), 0); + int sfilter = FilterArrayToInt(attrs->Get("states"), 0); if ((sfilter & ~(StateFilterUp | StateFilterDown | StateFilterOK | StateFilterWarning | StateFilterCritical | StateFilterUnknown)) != 0) { ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " + location + ": State filter is invalid."); } - int tfilter = FilterArrayToInt(attrs->Get("notification_type_filter"), 0); + int tfilter = FilterArrayToInt(attrs->Get("types"), 0); if ((tfilter & ~(1 << NotificationDowntimeStart | 1 << NotificationDowntimeEnd | 1 << NotificationDowntimeRemoved | 1 << NotificationCustom | 1 << NotificationAcknowledgement | 1 << NotificationProblem | 1 << NotificationRecovery |