[icinga-checkins] icinga.org: icinga-api/mhein/default: * Added contactgroup to history queries (mysql)

git at icinga.org git at icinga.org
Tue Jan 26 13:54:03 CET 2010


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

Author: Marius Hein <mhein at sasquatch.local.itsocks.de>
Date:   Tue Jan 26 13:53:46 2010 +0100

* Added contactgroup to history queries (mysql)

---

 .../data_interfaces/IcingaApiSearchIdoMysql.php    |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/objects/search/data_interfaces/IcingaApiSearchIdoMysql.php b/objects/search/data_interfaces/IcingaApiSearchIdoMysql.php
index 358b189..825a94f 100644
--- a/objects/search/data_interfaces/IcingaApiSearchIdoMysql.php
+++ b/objects/search/data_interfaces/IcingaApiSearchIdoMysql.php
@@ -236,6 +236,11 @@ class IcingaApiSearchIdoMysql
 				${TABLE_PREFIX}statehistory sh
 			${if_table:oh:inner join ${TABLE_PREFIX}objects oh on oh.object_id = sh.object_id and oh.objecttype_id = 1}
 			${if_table:h,oh:inner join ${TABLE_PREFIX}hosts h on h.host_object_id = oh.object_id}
+			${if_table:hcg,h:inner join ${TABLE_PREFIX}host_contactgroups hcg on hcg.host_id = h.host_id}
+			${if_table:cg,h:inner join ${TABLE_PREFIX}contactgroups cg on cg.contactgroup_object_id = hcg.contactgroup_object_id}
+			${if_table:ocg,hcg,h:inner join ${TABLE_PREFIX}objects ocg on ocg.object_id = hcg.contactgroup_object_id and ocg.objecttype_id = 11}
+			${if_table:cgm,cg,hcg,h:inner join ${TABLE_PREFIX}contactgroup_members cgm on cgm.contactgroup_id = cg.contactgroup_id}
+			${if_table:oc,cgm,cg,hcg,h:inner join ${TABLE_PREFIX}objects oc on oc.object_id = cgm.contact_object_id}
 			${if_table:hgm,oh:inner join ${TABLE_PREFIX}hostgroup_members hgm on hgm.host_object_id = oh.object_id}
 			${if_table:hg,hgm,oh:inner join ${TABLE_PREFIX}hostgroups hg on hg.hostgroup_id = hgm.hostgroup_id}
 			${if_table:ohg,hg,hgm,oh:inner join ${TABLE_PREFIX}objects ohg on ohg.object_id = hg.hostgroup_object_id}
@@ -254,6 +259,10 @@ class IcingaApiSearchIdoMysql
 			${if_table:s,os:inner join ${TABLE_PREFIX}services s on s.service_object_id = os.object_id}
 			${if_table:oh,s,os:inner join ${TABLE_PREFIX}objects oh on oh.object_id = s.host_object_id}
 			${if_table:h,oh,s,os:inner join ${TABLE_PREFIX}hosts h on h.host_object_id = oh.object_id}
+			${if_table:scg,s:inner join ${TABLE_PREFIX}service_contactgroups scg on scg.service_id = s.service_id}
+			${if_table:cg,scg,s:inner join ${TABLE_PREFIX}contactgroups cg on cg.contactgroup_object_id = scg.contactgroup_object_id}
+			${if_table:cgm,cg,scg,s:inner join ${TABLE_PREFIX}contactgroup_members cgm on cgm.contactgroup_id = cg.contactgroup_id}
+			${if_table:oc,cgm,cg,scg,s:inner join ${TABLE_PREFIX}objects oc on oc.object_id = cgm.contact_object_id}
 			${if_table:hgm,oh,s,os:inner join ${TABLE_PREFIX}hostgroup_members hgm on hgm.host_object_id = oh.object_id}
 			${if_table:hg,hgm,oh,s,os:inner join ${TABLE_PREFIX}hostgroups hg on hg.hostgroup_id = hgm.hostgroup_id}
 			${if_table:ohg,hg,hgm,oh,s,os:inner join ${TABLE_PREFIX}objects ohg on ohg.object_id = hg.hostgroup_object_id}





More information about the icinga-checkins mailing list