[icinga-checkins] icinga.org: icinga-api/cdoebler/default: * Added joins for host- and servicegroups

git at icinga.org git at icinga.org
Tue Oct 20 14:59:08 CEST 2009


Module: icinga-api
Branch: cdoebler/default
Commit: 06dcf258c220dd95ecb4b8a618dd0fe1943753a1
URL:    https://git.icinga.org/?p=icinga-api.git;a=commit;h=06dcf258c220dd95ecb4b8a618dd0fe1943753a1

Author: Marius Hein <marius.hein at netways.de>
Date:   Tue Oct 20 14:56:05 2009 +0200

* Added joins for host- and servicegroups

---

 objects/search/IcingaApiSearchIdo.php |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/objects/search/IcingaApiSearchIdo.php b/objects/search/IcingaApiSearchIdo.php
index 0a8c893..594c7af 100644
--- a/objects/search/IcingaApiSearchIdo.php
+++ b/objects/search/IcingaApiSearchIdo.php
@@ -28,6 +28,9 @@ class IcingaApiSearchIdo
 			inner join ${TABLE_PREFIX}objects ocg on ocg.object_id = hcg.contactgroup_object_id
 			inner join ${TABLE_PREFIX}contactgroup_members cgm on cgm.contactgroup_id = cg.contactgroup_id
 			inner join ${TABLE_PREFIX}objects oc on oc.object_id = cgm.contact_object_id
+			Inner Join ${TABLE_PREFIX}hostgroup_members AS hgm ON hgm.host_object_id = oh.object_id
+			Inner Join ${TABLE_PREFIX}hostgroups AS hg ON hg.hostgroup_id = hgm.hostgroup_id
+			Inner Join ${TABLE_PREFIX}objects AS ohg ON ohg.object_id = hg.hostgroup_object_id
 			where
 				oh.objecttype_id = 1
 				and ocg.objecttype_id = 11
@@ -50,6 +53,9 @@ class IcingaApiSearchIdo
 			inner join ${TABLE_PREFIX}objects ocg on ocg.object_id = scg.contactgroup_object_id
 			inner join ${TABLE_PREFIX}hoststatus hs on hs.host_object_id = s.host_object_id
 			inner join ${TABLE_PREFIX}objects oh on oh.object_id = s.host_object_id
+			Left Join icinga_servicegroup_members AS sgm ON sgm.service_object_id = os.object_id
+			Left Join icinga_servicegroups AS sg ON sg.servicegroup_id = sgm.servicegroup_id
+			Left Join icinga_objects AS osg ON osg.object_id = sg.servicegroup_object_id
 			where
 				oh.objecttype_id = 1
 				and os.objecttype_id = 2





More information about the icinga-checkins mailing list