Icinga DB: don't include checkable types in history IDs

... as they’re unnecessary for being distinguish across types.
Services always have a ! in the name, hosts never do.
This commit is contained in:
Alexander Aleksandrovič Klimov 2021-10-11 16:14:30 +02:00 committed by GitHub
parent 30a5ba3961
commit e0339c387b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -2011,7 +2011,7 @@ void IcingaDB::SendFlappingChange(const Checkable::Ptr& checkable, double change
xAdd.emplace_back("start_time"); xAdd.emplace_back("start_time");
xAdd.emplace_back(Convert::ToString(startTime)); xAdd.emplace_back(Convert::ToString(startTime));
xAdd.emplace_back("id"); xAdd.emplace_back("id");
xAdd.emplace_back(HashValue(new Array({GetEnvironment(), checkable->GetReflectionType()->GetName(), checkable->GetName(), startTime}))); xAdd.emplace_back(HashValue(new Array({GetEnvironment(), checkable->GetName(), startTime})));
m_Rcon->FireAndForgetQuery(std::move(xAdd), Prio::History); m_Rcon->FireAndForgetQuery(std::move(xAdd), Prio::History);
} }
@ -2091,7 +2091,7 @@ void IcingaDB::SendAcknowledgementSet(const Checkable::Ptr& checkable, const Str
xAdd.emplace_back("set_time"); xAdd.emplace_back("set_time");
xAdd.emplace_back(Convert::ToString(setTime)); xAdd.emplace_back(Convert::ToString(setTime));
xAdd.emplace_back("id"); xAdd.emplace_back("id");
xAdd.emplace_back(HashValue(new Array({GetEnvironment(), checkable->GetReflectionType()->GetName(), checkable->GetName(), setTime}))); xAdd.emplace_back(HashValue(new Array({GetEnvironment(), checkable->GetName(), setTime})));
m_Rcon->FireAndForgetQuery(std::move(xAdd), Prio::History); m_Rcon->FireAndForgetQuery(std::move(xAdd), Prio::History);
} }
@ -2136,7 +2136,7 @@ void IcingaDB::SendAcknowledgementCleared(const Checkable::Ptr& checkable, const
xAdd.emplace_back("set_time"); xAdd.emplace_back("set_time");
xAdd.emplace_back(Convert::ToString(setTime)); xAdd.emplace_back(Convert::ToString(setTime));
xAdd.emplace_back("id"); xAdd.emplace_back("id");
xAdd.emplace_back(HashValue(new Array({GetEnvironment(), checkable->GetReflectionType()->GetName(), checkable->GetName(), setTime}))); xAdd.emplace_back(HashValue(new Array({GetEnvironment(), checkable->GetName(), setTime})));
if (!removedBy.IsEmpty()) { if (!removedBy.IsEmpty()) {
xAdd.emplace_back("cleared_by"); xAdd.emplace_back("cleared_by");