mirror of https://github.com/Icinga/icinga2.git
parent
b9d00dfa8f
commit
0691d73af9
|
@ -209,7 +209,7 @@ Example:
|
||||||
parent_host_name = "internet"
|
parent_host_name = "internet"
|
||||||
parent_service_name = "ping4"
|
parent_service_name = "ping4"
|
||||||
|
|
||||||
state_filter = [ OK, Warning ]
|
states = [ OK, Warning ]
|
||||||
|
|
||||||
disable_checks = true
|
disable_checks = true
|
||||||
}
|
}
|
||||||
|
@ -225,7 +225,7 @@ Attributes:
|
||||||
disable_checks |**Optional.** Whether to disable checks when this dependency fails. Defaults to false.
|
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.
|
disable_notifications|**Optional.** Whether to disable notifications when this dependency fails. Defaults to true.
|
||||||
period |**Optional.** Time period during which this dependency is enabled.
|
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:
|
Available state filters:
|
||||||
|
|
||||||
|
|
|
@ -275,7 +275,7 @@
|
||||||
|
|
||||||
%attribute %name(TimePeriod) "period",
|
%attribute %name(TimePeriod) "period",
|
||||||
|
|
||||||
%attribute %array "state_filter" {
|
%attribute %array "states" {
|
||||||
%attribute %number "*"
|
%attribute %number "*"
|
||||||
},
|
},
|
||||||
%attribute %number "disable_checks",
|
%attribute %number "disable_checks",
|
||||||
|
|
|
@ -438,7 +438,7 @@ int icinga::FilterArrayToInt(const Array::Ptr& typeFilters, int defaultValue)
|
||||||
|
|
||||||
void Notification::ValidateFilters(const String& location, const Dictionary::Ptr& attrs)
|
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) {
|
if (!attrs->Contains("service_name") && (sfilter & ~(StateFilterUp | StateFilterDown)) != 0) {
|
||||||
ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " +
|
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.");
|
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 |
|
if ((tfilter & ~(1 << NotificationDowntimeStart | 1 << NotificationDowntimeEnd | 1 << NotificationDowntimeRemoved |
|
||||||
1 << NotificationCustom | 1 << NotificationAcknowledgement | 1 << NotificationProblem | 1 << NotificationRecovery |
|
1 << NotificationCustom | 1 << NotificationAcknowledgement | 1 << NotificationProblem | 1 << NotificationRecovery |
|
||||||
|
|
|
@ -91,14 +91,14 @@ TimePeriod::Ptr User::GetPeriod(void) const
|
||||||
|
|
||||||
void User::ValidateFilters(const String& location, const Dictionary::Ptr& attrs)
|
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) {
|
if ((sfilter & ~(StateFilterUp | StateFilterDown | StateFilterOK | StateFilterWarning | StateFilterCritical | StateFilterUnknown)) != 0) {
|
||||||
ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " +
|
ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " +
|
||||||
location + ": State filter is invalid.");
|
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 |
|
if ((tfilter & ~(1 << NotificationDowntimeStart | 1 << NotificationDowntimeEnd | 1 << NotificationDowntimeRemoved |
|
||||||
1 << NotificationCustom | 1 << NotificationAcknowledgement | 1 << NotificationProblem | 1 << NotificationRecovery |
|
1 << NotificationCustom | 1 << NotificationAcknowledgement | 1 << NotificationProblem | 1 << NotificationRecovery |
|
||||||
|
|
Loading…
Reference in New Issue