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/EmptyhostgroupQuery.php | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 modules/monitoring/library/Monitoring/Backend/Ido/Query/EmptyhostgroupQuery.php (limited to 'modules/monitoring/library/Monitoring/Backend/Ido/Query/EmptyhostgroupQuery.php') diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EmptyhostgroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EmptyhostgroupQuery.php new file mode 100644 index 0000000..a99d6b7 --- /dev/null +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EmptyhostgroupQuery.php @@ -0,0 +1,38 @@ + [ + 'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci', + 'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci', + 'hostgroup_name' => 'hgo.name1', + 'host_name' => '(NULL)', + 'service_description' => '(NULL)', + 'servicegroup_name' => '(NULL)', + 'host_contact' => '(NULL)', + 'host_contactgroup' => '(NULL)' + ], + 'instances' => [ + 'instance_name' => 'i.instance_name' + ] + ]; + + protected function joinBaseTables() + { + parent::joinBaseTables(); + + $this->select->joinLeft( + ['ehgm' => $this->prefix . 'hostgroup_members'], + 'ehgm.hostgroup_id = hg.hostgroup_id', + [] + ); + $this->select->group(['hgo.object_id', 'hg.hostgroup_id']); + $this->select->having('COUNT(ehgm.hostgroup_member_id) = ?', 0); + } +} -- cgit v1.2.3