From 4b0313d3f356b2838ac0b9a641d165cd7ed662c9 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Wed, 2 Dec 2020 12:24:40 +0100 Subject: [PATCH] On recovery: re-check children --- lib/icinga/checkable-check.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/icinga/checkable-check.cpp b/lib/icinga/checkable-check.cpp index 5aac602cd..a6899d944 100644 --- a/lib/icinga/checkable-check.cpp +++ b/lib/icinga/checkable-check.cpp @@ -242,6 +242,20 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig OnReachabilityChanged(this, cr, children, origin); } + if (recovery) { + for (auto& child : children) { + if (child->GetProblem() && child->GetEnableActiveChecks()) { + auto nextCheck (now + Utility::Random() % 60); + + ObjectLock oLock (child); + + if (nextCheck < child->GetNextCheck()) { + child->SetNextCheck(nextCheck); + } + } + } + } + if (!reachable) SetLastStateUnreachable(Utility::GetTime());