From 07c0c9e234c2eaed76e1238e8c2e5519e6c39375 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Fri, 2 May 2014 19:37:55 +0200 Subject: [PATCH] Fix state_filter attribute validation for Depdency objects. Fixes #6110 --- lib/icinga/dependency.cpp | 5 +++-- lib/icinga/icinga-type.conf | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/icinga/dependency.cpp b/lib/icinga/dependency.cpp index c38062434..4b74fd6f3 100644 --- a/lib/icinga/dependency.cpp +++ b/lib/icinga/dependency.cpp @@ -23,6 +23,7 @@ #include "base/dynamictype.h" #include "base/objectlock.h" #include "base/logger_fwd.h" +#include "base/convert.h" #include "base/scriptfunction.h" #include @@ -184,11 +185,11 @@ void Dependency::ValidateFilters(const String& location, const Dictionary::Ptr& if (!attrs->Contains("parent_service_name") && (sfilter & ~(StateFilterUp | StateFilterDown)) != 0) { ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " + - location + ": State filter is invalid."); + location + ": State filter is invalid for host dependency."); } if (attrs->Contains("parent_service_name") && (sfilter & ~(StateFilterOK | StateFilterWarning | StateFilterCritical | StateFilterUnknown)) != 0) { ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " + - location + ": State filter is invalid."); + location + ": State filter is invalid for service dependency."); } } diff --git a/lib/icinga/icinga-type.conf b/lib/icinga/icinga-type.conf index 43e493ab4..253acdc94 100644 --- a/lib/icinga/icinga-type.conf +++ b/lib/icinga/icinga-type.conf @@ -275,7 +275,9 @@ %attribute %name(TimePeriod) "period", - %attribute %number "state_filter", + %attribute %array "state_filter" { + %attribute %number "*" + }, %attribute %number "disable_checks", %attribute %number "disable_notifications" } -- 2.40.0