RedisWriter: add icinga:history:stream:*#endpoint_id

This commit is contained in:
Alexander A. Klimov 2019-10-23 10:54:56 +02:00 committed by Michael Friedrich
parent 8613365f1c
commit 4a7a8cb6f8
1 changed files with 56 additions and 0 deletions

View File

@ -1205,6 +1205,13 @@ void RedisWriter::SendStatusUpdate(const ConfigObject::Ptr& object, const CheckR
xAdd.emplace_back(GetObjectIdentifier(checkable));
}
auto endpoint (Endpoint::GetLocalEndpoint());
if (endpoint) {
xAdd.emplace_back("endpoint_id");
xAdd.emplace_back(GetObjectIdentifier(endpoint));
}
m_Rcon->FireAndForgetQuery(std::move(xAdd));
}
@ -1246,6 +1253,13 @@ void RedisWriter::SendSentNotification(
xAdd.emplace_back(GetObjectIdentifier(checkable));
}
auto endpoint (Endpoint::GetLocalEndpoint());
if (endpoint) {
xAdd.emplace_back("endpoint_id");
xAdd.emplace_back(GetObjectIdentifier(endpoint));
}
m_Rcon->FireAndForgetQuery(std::move(xAdd));
}
@ -1306,6 +1320,13 @@ void RedisWriter::SendAddedDowntime(const Downtime::Ptr& downtime)
xAdd.emplace_back(Convert::ToString(TimestampToMilliseconds(downtime->GetTriggerTime() + downtime->GetDuration())));
}
auto endpoint (Endpoint::GetLocalEndpoint());
if (endpoint) {
xAdd.emplace_back("endpoint_id");
xAdd.emplace_back(GetObjectIdentifier(endpoint));
}
m_Rcon->FireAndForgetQuery(std::move(xAdd));
}
@ -1368,6 +1389,13 @@ void RedisWriter::SendStartedDowntime(const Downtime::Ptr& downtime)
xAdd.emplace_back(Convert::ToString(TimestampToMilliseconds(downtime->GetTriggerTime() + downtime->GetDuration())));
}
auto endpoint (Endpoint::GetLocalEndpoint());
if (endpoint) {
xAdd.emplace_back("endpoint_id");
xAdd.emplace_back(GetObjectIdentifier(endpoint));
}
m_Rcon->FireAndForgetQuery(std::move(xAdd));
}
@ -1429,6 +1457,13 @@ void RedisWriter::SendRemovedDowntime(const Downtime::Ptr& downtime)
xAdd.emplace_back(Convert::ToString(TimestampToMilliseconds(downtime->GetTriggerTime() + downtime->GetDuration())));
}
auto endpoint (Endpoint::GetLocalEndpoint());
if (endpoint) {
xAdd.emplace_back("endpoint_id");
xAdd.emplace_back(GetObjectIdentifier(endpoint));
}
m_Rcon->FireAndForgetQuery(std::move(xAdd));
}
@ -1466,6 +1501,13 @@ void RedisWriter::SendAddedComment(const Comment::Ptr& comment)
xAdd.emplace_back(GetObjectIdentifier(checkable));
}
auto endpoint (Endpoint::GetLocalEndpoint());
if (endpoint) {
xAdd.emplace_back("endpoint_id");
xAdd.emplace_back(GetObjectIdentifier(endpoint));
}
m_Rcon->FireAndForgetQuery(std::move(xAdd));
}
@ -1504,6 +1546,13 @@ void RedisWriter::SendRemovedComment(const Comment::Ptr& comment)
xAdd.emplace_back(GetObjectIdentifier(checkable));
}
auto endpoint (Endpoint::GetLocalEndpoint());
if (endpoint) {
xAdd.emplace_back("endpoint_id");
xAdd.emplace_back(GetObjectIdentifier(endpoint));
}
m_Rcon->FireAndForgetQuery(std::move(xAdd));
}
@ -1539,6 +1588,13 @@ void RedisWriter::SendFlappingChanged(const Checkable::Ptr& checkable, const Val
xAdd.emplace_back(GetObjectIdentifier(checkable));
}
auto endpoint (Endpoint::GetLocalEndpoint());
if (endpoint) {
xAdd.emplace_back("endpoint_id");
xAdd.emplace_back(GetObjectIdentifier(endpoint));
}
m_Rcon->FireAndForgetQuery(std::move(xAdd));
}