From 14c02ec654f006d386e60c30d819667c454e5f6f Mon Sep 17 00:00:00 2001 From: Mattia Codato Date: Thu, 23 Jul 2020 12:58:50 +0200 Subject: [PATCH] Remove unuseful check result for notification command --- lib/icinga/clusterevents-check.cpp | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/lib/icinga/clusterevents-check.cpp b/lib/icinga/clusterevents-check.cpp index 17e8e9649..af124cb32 100644 --- a/lib/icinga/clusterevents-check.cpp +++ b/lib/icinga/clusterevents-check.cpp @@ -322,29 +322,15 @@ void ClusterEvents::ExecuteCheckFromQueue(const MessageOrigin::Ptr& origin, cons notificationCommand->Execute(notification, user, cr, NotificationType::NotificationCustom, author, ""); } catch (const std::exception& ex) { - String output = "Exception occurred during notification '" + notification->GetName() - + "' for checkable '" + notification->GetCheckable()->GetName() - + "' and user '" + user->GetName() + "' using command '" + command + "': " - + DiagnosticInformation(ex, false); - double now = Utility::GetTime(); - ServiceState state = ServiceUnknown; - if (params->Contains("source")) { + String output = "Exception occurred during notification '" + notification->GetName() + + "' for checkable '" + notification->GetCheckable()->GetName() + + "' and user '" + user->GetName() + "' using command '" + command + "': " + + DiagnosticInformation(ex, false); + double now = Utility::GetTime(); + ServiceState state = ServiceUnknown; SendEventExecuteCommand(params, state, output, now, now, listener, origin, sourceEndpoint); - } else { - CheckResult::Ptr cr = new CheckResult(); - cr->SetState(state); - cr->SetOutput(output); - cr->SetScheduleStart(now); - cr->SetScheduleEnd(now); - cr->SetExecutionStart(now); - cr->SetExecutionEnd(now); - - Dictionary::Ptr message = MakeCheckResultMessage(host, cr); - listener->SyncSendMessage(sourceEndpoint, message); } - - Log(LogCritical, "checker", output); } } }