From 670835fd9a21272596128b12853722ab571c5849 Mon Sep 17 00:00:00 2001 From: Mattia Codato Date: Fri, 3 Jul 2020 08:43:50 +0200 Subject: [PATCH] Get last CheckResult --- lib/icinga/apiactions.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/icinga/apiactions.cpp b/lib/icinga/apiactions.cpp index 1698133f9..97f93ca5a 100644 --- a/lib/icinga/apiactions.cpp +++ b/lib/icinga/apiactions.cpp @@ -636,12 +636,7 @@ Dictionary::Ptr ApiActions::ExecuteCommand(const ConfigObject::Ptr& object, MacroProcessor::EscapeCallback(), nullptr, false ); - double scheduled_start = checkable->GetNextCheck(); - double before_check = Utility::GetTime(); - - CheckResult::Ptr cr = new CheckResult(); - cr->SetScheduleStart(scheduled_start); - cr->SetExecutionStart(before_check); + CheckResult::Ptr cr = checkable->GetLastCheckResult(); /* Check if resolved_command exists and it is of type command_type */ Dictionary::Ptr execMacros = new Dictionary();