diff --git a/lib/icinga/clusterevents-check.cpp b/lib/icinga/clusterevents-check.cpp index 63b2478f9..0ca53030c 100644 --- a/lib/icinga/clusterevents-check.cpp +++ b/lib/icinga/clusterevents-check.cpp @@ -88,9 +88,9 @@ static void SendEventExecuteCommand(const Dictionary::Ptr& params, long exitStat executedParams->Set("start", start); executedParams->Set("end", end); - ClusterEvents::ExecutedCommandAPIHandler(origin, executedParams); - - if (!origin->IsLocal()) { + if (origin->IsLocal()) { + ClusterEvents::ExecutedCommandAPIHandler(origin, executedParams); + } else { Dictionary::Ptr executedMessage = new Dictionary(); executedMessage->Set("jsonrpc", "2.0"); executedMessage->Set("method", "event::ExecutedCommand"); diff --git a/lib/icinga/clusterevents.cpp b/lib/icinga/clusterevents.cpp index 70aca9765..5817d8cc8 100644 --- a/lib/icinga/clusterevents.cpp +++ b/lib/icinga/clusterevents.cpp @@ -1038,7 +1038,7 @@ Value ClusterEvents::ExecutedCommandAPIHandler(const MessageOrigin::Ptr& origin, updateMessage->Set("method", "event::UpdateExecutions"); updateMessage->Set("params", updateParams); - listener->RelayMessage(origin, checkable, updateMessage, true); + listener->RelayMessage(nullptr, checkable, updateMessage, true); return Empty; }