diff --git a/lib/config/expression.cpp b/lib/config/expression.cpp index 3a240a770..93471cca2 100644 --- a/lib/config/expression.cpp +++ b/lib/config/expression.cpp @@ -220,16 +220,17 @@ void Expression::Extract(const std::vector& path, const ExpressionList:: ASSERT(!path.empty()); if (path[0] == m_Key) { - if (path.size() == 1) { - result->AddExpression(*this); - - return; - } - if (!m_Value.IsObjectType()) BOOST_THROW_EXCEPTION(std::invalid_argument("Specified path does not exist.")); ExpressionList::Ptr exprl = m_Value; + + if (path.size() == 1) { + result->AddExpression(Expression("", OperatorExecute, exprl, m_DebugInfo)); + + return; + } + std::vector sub_path(path.begin() + 1, path.end()); exprl->Extract(sub_path, result); } else if (m_Operator == OperatorExecute) { diff --git a/lib/icinga/service-check.cpp b/lib/icinga/service-check.cpp index 76c02bb77..64603cef8 100644 --- a/lib/icinga/service-check.cpp +++ b/lib/icinga/service-check.cpp @@ -643,6 +643,8 @@ void Service::BeginExecuteCheck(const boost::function& callback) { ASSERT(!OwnsLock()); + bool reachable = IsReachable(); + { ObjectLock olock(this); @@ -660,10 +662,9 @@ void Service::BeginExecuteCheck(const boost::function& callback) SetLastState(GetState()); SetLastStateType(GetLastStateType()); + SetLastReachable(reachable); } - SetLastReachable(IsReachable()); - /* keep track of scheduling info in case the check type doesn't provide its own information */ Dictionary::Ptr checkInfo = boost::make_shared(); checkInfo->Set("schedule_start", GetNextCheck());