From 925cfb6c6466a58253fe83be7086a3c4f5c697bc Mon Sep 17 00:00:00 2001 From: Noah Hilverling Date: Thu, 12 Nov 2020 16:16:36 +0100 Subject: [PATCH] Cluster: Add timestamp to "ExecuteCommand" and "CheckResult" --- lib/icinga/checkable-check.cpp | 3 +++ lib/icinga/clusterevents.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/icinga/checkable-check.cpp b/lib/icinga/checkable-check.cpp index 5aac602cd..b00674d9f 100644 --- a/lib/icinga/checkable-check.cpp +++ b/lib/icinga/checkable-check.cpp @@ -538,6 +538,9 @@ void Checkable::ExecuteCheck() message->Set("jsonrpc", "2.0"); message->Set("method", "event::ExecuteCommand"); + double ts = Utility::GetTime(); + message->Set("ts", ts); + Host::Ptr host; Service::Ptr service; tie(host, service) = GetHostService(this); diff --git a/lib/icinga/clusterevents.cpp b/lib/icinga/clusterevents.cpp index 1651dde71..6d8961f71 100644 --- a/lib/icinga/clusterevents.cpp +++ b/lib/icinga/clusterevents.cpp @@ -57,6 +57,9 @@ Dictionary::Ptr ClusterEvents::MakeCheckResultMessage(const Checkable::Ptr& chec message->Set("jsonrpc", "2.0"); message->Set("method", "event::CheckResult"); + double ts = Utility::GetTime(); + message->Set("ts", ts); + Host::Ptr host; Service::Ptr service; tie(host, service) = GetHostService(checkable);