diff --git a/lib/icingadb/icingadb-objects.cpp b/lib/icingadb/icingadb-objects.cpp index f972546a1..e0b08d2a6 100644 --- a/lib/icingadb/icingadb-objects.cpp +++ b/lib/icingadb/icingadb-objects.cpp @@ -981,11 +981,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) @@ -1019,11 +1020,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()); @@ -1058,11 +1057,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()));