IcingaDB: Remove unnecessary service_/host_ids

This commit is contained in:
Noah Hilverling 2019-12-05 07:35:05 +01:00
parent 92e51a3f87
commit 3e832900f6
1 changed files with 2 additions and 5 deletions

View File

@ -974,11 +974,12 @@ bool IcingaDB::PrepareObject(const ConfigObject::Ptr& object, Dictionary::Ptr& a
tie(host, service) = GetHostService(notification->GetCheckable());
attributes->Set("host_id", GetObjectIdentifier(host));
attributes->Set("command_id", GetObjectIdentifier(notification->GetCommand()));
if (service)
attributes->Set("service_id", GetObjectIdentifier(service));
else
attributes->Set("host_id", GetObjectIdentifier(host));
TimePeriod::Ptr timeperiod = notification->GetPeriod();
if (timeperiod)
@ -1012,11 +1013,9 @@ bool IcingaDB::PrepareObject(const ConfigObject::Ptr& object, Dictionary::Ptr& a
if (service) {
attributes->Set("object_type", "service");
attributes->Set("service_id", GetObjectIdentifier(service));
attributes->Set("host_id", "00000000000000000000000000000000");
} else {
attributes->Set("object_type", "host");
attributes->Set("host_id", GetObjectIdentifier(host));
attributes->Set("service_id", "00000000000000000000000000000000");
}
auto expireTime (comment->GetExpireTime());
@ -1051,11 +1050,9 @@ bool IcingaDB::PrepareObject(const ConfigObject::Ptr& object, Dictionary::Ptr& a
if (service) {
attributes->Set("object_type", "service");
attributes->Set("service_id", GetObjectIdentifier(service));
attributes->Set("host_id", "00000000000000000000000000000000");
} else {
attributes->Set("object_type", "host");
attributes->Set("host_id", GetObjectIdentifier(host));
attributes->Set("service_id", "00000000000000000000000000000000");
}
auto triggeredBy (Downtime::GetByName(downtime->GetTriggeredBy()));