From 64d1d12c7347a7027f8547079325f9ba107289d8 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 6 Mar 2015 10:02:20 +0100 Subject: [PATCH] Do not join icinga_hosts when fetching a service's contact groups refs #8614 --- .../library/Monitoring/Object/MonitoredObject.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php index 4baa7aa9b..bf417c4f4 100644 --- a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php +++ b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php @@ -426,10 +426,12 @@ abstract class MonitoredObject implements Filterable $contactsGroups = $this->backend->select()->from('contactgroup', array( 'contactgroup_name', 'contactgroup_alias' - )) - ->where('host_name', $this->host_name); + )); if ($this->type === self::TYPE_SERVICE) { + $contactsGroups->where('service_host_name', $this->host_name); $contactsGroups->where('service_description', $this->service_description); + } else { + $contactsGroups->where('host_name', $this->host_name); } $this->contactgroups = $contactsGroups->getQuery()->fetchAll(); return $this;