From 8ca6cc32b2c789a3149861159ad258f2cb9491e3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:39:39 +0200 Subject: Adding upstream version 2.11.4. Signed-off-by: Daniel Baumann --- .../Backend/Ido/Query/EmptyservicegroupQuery.php | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 modules/monitoring/library/Monitoring/Backend/Ido/Query/EmptyservicegroupQuery.php (limited to 'modules/monitoring/library/Monitoring/Backend/Ido/Query/EmptyservicegroupQuery.php') diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EmptyservicegroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EmptyservicegroupQuery.php new file mode 100644 index 0000000..88ee4c3 --- /dev/null +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EmptyservicegroupQuery.php @@ -0,0 +1,51 @@ + [ + 'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci', + 'servicegroup_alias' => 'sg.alias COLLATE latin1_general_ci', + 'servicegroup_name' => 'sgo.name1', + 'host_name' => '(NULL)', + 'hostgroup_name' => '(NULL)', + 'service_description' => '(NULL)', + 'host_contact' => '(NULL)', + 'host_contactgroup' => '(NULL)', + 'service_contact' => '(NULL)', + 'service_contactgroup' => '(NULL)' + ], + 'instances' => [ + 'instance_name' => 'i.instance_name' + ] + ]; + + protected function joinBaseTables() + { + parent::joinBaseTables(); + + $this->select->joinLeft( + ['esgm' => $this->prefix . 'servicegroup_members'], + 'esgm.servicegroup_id = sg.servicegroup_id', + [] + ); + $this->select->group(['sgo.object_id', 'sg.servicegroup_id']); + $this->select->having('COUNT(esgm.servicegroup_member_id) = ?', 0); + } + + protected function joinHosts() + { + parent::joinHosts(); + + $this->select->joinLeft( + ['h' => 'icinga_hosts'], + 'h.host_object_id = s.host_object_id', + [] + ); + } +} -- cgit v1.2.3