Rename Dependency 'state_filter' to 'states'.

Fixes #6113
This commit is contained in:
Michael Friedrich 2014-05-03 19:53:16 +02:00
parent b9d00dfa8f
commit 0691d73af9
4 changed files with 7 additions and 7 deletions

View File

@ -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:

View File

@ -275,7 +275,7 @@
%attribute %name(TimePeriod) "period",
%attribute %array "state_filter" {
%attribute %array "states" {
%attribute %number "*"
},
%attribute %number "disable_checks",

View File

@ -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 |

View File

@ -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 |