[icinga-checkins] icinga.org: icinga-api/master: * oci8: Fixed customvariablestatus linking

git at icinga.org git at icinga.org
Tue Jul 12 12:38:50 CEST 2011


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

Author: Eric Lippmann <eric.lippmann at netways.de>
Date:   Fri Jul  1 14:59:51 2011 +0200

* oci8: Fixed customvariablestatus linking
* oci8: Fixed service status query

---

 .../data_interfaces/IcingaApiSearchIdoOci8.php     |   52 ++++++++++---------
 1 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/objects/search/data_interfaces/IcingaApiSearchIdoOci8.php b/objects/search/data_interfaces/IcingaApiSearchIdoOci8.php
index 83718de..c844145 100644
--- a/objects/search/data_interfaces/IcingaApiSearchIdoOci8.php
+++ b/objects/search/data_interfaces/IcingaApiSearchIdoOci8.php
@@ -63,8 +63,8 @@ class IcingaApiSearchIdoOci8
 			${if_table:hgm:inner join ${TABLE_PREFIX}hostgroup_members hgm on hgm.host_object_id = oh.id}
 			${if_table:hg,hgm:inner join ${TABLE_PREFIX}hostgroups hg on hg.id = hgm.hostgroup_id}
 			${if_table:ohg,hg,hgm:inner join ${TABLE_PREFIX}objects ohg on ohg.id = hg.hostgroup_object_id}
-			${if_table:cvsh,oh:inner join ${TABLE_PREFIX}customvariablestatus cvsh on oh.id = cvsh.id}
-			${if_table:cvsc,oc,cgm,cg,hcg,h:inner join ${TABLE_PREFIX}customvariablestatus cvsc on oc.id = cvsc.id}
+			${if_table:cvsh,oh:inner join ${TABLE_PREFIX}customvariablestatus cvsh on oh.id = cvsh.object_id}
+			${if_table:cvsc,oc,cgm,cg,hcg,h:inner join ${TABLE_PREFIX}customvariablestatus cvsc on oc.id = cvsc.object_id}
 			where
 				oh.objecttype_id = 1 and h.config_type=${CONFIG_TYPE}
 			${FILTER_AND}
@@ -94,9 +94,9 @@ class IcingaApiSearchIdoOci8
 			${if_table:hgm,oh,s:inner join ${TABLE_PREFIX}hostgroup_members hgm on hgm.host_object_id = oh.id}
 			${if_table:hg,hgm,oh,s:inner join ${TABLE_PREFIX}hostgroups hg on hg.id = hgm.hostgroup_id}
 			${if_table:ohg,hg,hgm,oh,s:inner join ${TABLE_PREFIX}objects ohg on ohg.id = hg.hostgroup_object_id}
-			${if_table:cvsh,oh,s:inner join ${TABLE_PREFIX}customvariablestatus cvsh on oh.id = cvsh.id}
-			${if_table:cvss:inner join ${TABLE_PREFIX}customvariablestatus cvss on os.id = cvss.id}
-			${if_table:cvsc,oc,cgm,cg,scg,s:inner join ${TABLE_PREFIX}customvariablestatus cvsc on oc.id = cvsc.id}
+			${if_table:cvsh,oh,s:inner join ${TABLE_PREFIX}customvariablestatus cvsh on oh.id = cvsh.object_id}
+			${if_table:cvss:inner join ${TABLE_PREFIX}customvariablestatus cvss on os.id = cvss.object_id}
+			${if_table:cvsc,oc,cgm,cg,scg,s:inner join ${TABLE_PREFIX}customvariablestatus cvsc on oc.id = cvsc.obect_id}
 			where
 				os.objecttype_id = 2 and s.config_type=${CONFIG_TYPE}
 			${FILTER_AND}
@@ -139,7 +139,7 @@ class IcingaApiSearchIdoOci8
 			${if_table:cg:inner join ${TABLE_PREFIX}contactgroups cg on cg.contactgroup_object_id = ocg.id}
 			${if_table:cgm,cg:inner join ${TABLE_PREFIX}contactgroup_members cgm on cgm.contactgroup_id = cg.id}
 			${if_table:oc,cgm,cg:inner join ${TABLE_PREFIX}objects oc on oc.id = cgm.contact_object_id and oc.objecttype_id = 10}
-			${if_table:cvsc,oc,cgm,cg:inner join ${TABLE_PREFIX}customvariablestatus cvsc on oc.id = cvsc.id}
+			${if_table:cvsc,oc,cgm,cg:inner join ${TABLE_PREFIX}customvariablestatus cvsc on oc.id = cvsc.object_id}
 			where
 				ocg.objecttype_id = 11
 			${FILTER_AND}
@@ -220,8 +220,8 @@ class IcingaApiSearchIdoOci8
 			${if_table:hgm,oh:inner join ${TABLE_PREFIX}hostgroup_members hgm on hgm.host_object_id = oh.id}
 			${if_table:hg,hgm,oh:inner join ${TABLE_PREFIX}hostgroups hg on hg.id = hgm.hostgroup_id}
 			${if_table:ohg,hg,hgm,oh:inner join ${TABLE_PREFIX}objects ohg on ohg.id = hg.hostgroup_object_id}
-			${if_table:cvsh,oh:inner join ${TABLE_PREFIX}customvariablestatus cvsh on oh.id = cvsh.id}
-			${if_table:cvsc,oc,cgm,cg,hcg,h,oh: inner join ${TABLE_PREFIX}customvariablestatus cvsc on oc.id = cvsc.id}
+			${if_table:cvsh,oh:inner join ${TABLE_PREFIX}customvariablestatus cvsh on oh.id = cvsh.object_id}
+			${if_table:cvsc,oc,cgm,cg,hcg,h,oh: inner join ${TABLE_PREFIX}customvariablestatus cvsc on oc.id = cvsc.object_id}
 			where h.config_type=${CONFIG_TYPE}
 			${FILTER_AND}
 			group by
@@ -235,22 +235,24 @@ class IcingaApiSearchIdoOci8
 				${TABLE_PREFIX}servicestatus ss
 			inner join ${TABLE_PREFIX}objects os on os.id = ss.service_object_id
 			inner join ${TABLE_PREFIX}services s on s.service_object_id = os.id
-			inner join ${TABLE_PREFIX}instances i on i.id = s.instance_id
-			left join ${TABLE_PREFIX}hosts h on s.host_object_id = h.id
-			${if_table:scg,s,os: inner join ${TABLE_PREFIX}service_contactgroups scg on scg.service_id = s.id}
-			${if_table:cg,scg,s,os: inner join ${TABLE_PREFIX}contactgroups cg on cg.contactgroup_object_id = scg.contactgroup_object_id}
-			${if_table:cgm,cg,scg,s,os: inner join ${TABLE_PREFIX}contactgroup_members cgm on cgm.contactgroup_id = cg.id}
-			${if_table:oc,cgm,cg,scg,s,os: inner join ${TABLE_PREFIX}objects oc on oc.id = cgm.contact_object_id}
-			${if_table:ocg,scg,s,os: inner join ${TABLE_PREFIX}objects ocg on ocg.id = scg.contactgroup_object_id}
-			${if_table:hs,s,os,: inner join ${TABLE_PREFIX}hoststatus hs on hs.host_object_id = s.host_object_id}
-			${if_table:oh,s,os: inner join ${TABLE_PREFIX}objects oh on oh.id = s.host_object_id}
+			${if_table:i,s,os:inner join ${TABLE_PREFIX}instances i on i.instance_id = s.instance_id}
+			${if_table:scg,s,os:-- inner join ${TABLE_PREFIX}service_contactgroups scg on scg.service_id = s.service_id}
+			${if_table:cg,scg,s,os:-- inner join ${TABLE_PREFIX}contactgroups cg on cg.contactgroup_object_id = scg.contactgroup_object_id}
+			${if_table:cgm,cg,scg,s,os:-- inner join ${TABLE_PREFIX}contactgroup_members cgm on cgm.contactgroup_id = cg.contactgroup_id}
+			${if_table:oc,cgm,cg,scg,s,os:-- inner join ${TABLE_PREFIX}objects oc on oc.id = cgm.contact_object_id}
+			${if_table:ocg,scg,s,os:-- inner join ${TABLE_PREFIX}objects ocg on ocg.id = scg.contactgroup_object_id}
+			${if_table:hs,s,os,:-- inner join ${TABLE_PREFIX}hoststatus hs on hs.host_object_id = s.host_object_id}
+			${if_table:oh,s,os:inner join ${TABLE_PREFIX}objects oh on oh.id = s.host_object_id}
 			${if_table:hgm,oh,s,os:inner join ${TABLE_PREFIX}hostgroup_members hgm on hgm.host_object_id = oh.id}
 			${if_table:hg,hgm,oh,s,os:inner join ${TABLE_PREFIX}hostgroups hg on hg.id = hgm.hostgroup_id}
 			${if_table:ohg,hg,hgm,oh,s,os:inner join ${TABLE_PREFIX}objects ohg on ohg.id = hg.hostgroup_object_id}
-			${if_table:cvsh,oh,s,os:inner join ${TABLE_PREFIX}customvariablestatus cvsh on oh.id = cvsh.id}
-			${if_table:cvss,os:inner join ${TABLE_PREFIX}customvariablestatus cvss on os.id = cvss.id}
-			${if_table:cvsc,oc,cgm,cg,scg,s,os:inner join ${TABLE_PREFIX}customvariablestatus cvsc on oc.id = cvsc.id}
-			left join ${TABLE_PREFIX}objects osg on osg.id = h.host_object_id and osg.is_active = 1
+			${if_table:cvsh,oh,s,os:inner join ${TABLE_PREFIX}customvariablestatus cvsh on oh.id = cvsh.object_id}
+			${if_table:cvss,os:inner join ${TABLE_PREFIX}customvariablestatus cvss on os.id = cvss.object_id}
+			${if_table:cvsc,oc,cgm,cg,scg,s,os:-- inner join ${TABLE_PREFIX}customvariablestatus cvsc on oc.id = cvsc.object_id}
+
+			${if_table:sgm,os:left join ${TABLE_PREFIX}servicegroup_members sgm on sgm.service_object_id = os.id}
+			${if_table:sg,sgm,os:left join ${TABLE_PREFIX}servicegroups sg on sg.id = sgm.servicegroup_id}
+			${if_table:osg,sg,sgm,os:left join ${TABLE_PREFIX}objects osg on osg.id = sg.servicegroup_object_id}
 			where s.config_type=${CONFIG_TYPE}
 			${FILTER_AND}
 			group by
@@ -273,7 +275,7 @@ class IcingaApiSearchIdoOci8
 			${if_table:hgm,oh:inner join ${TABLE_PREFIX}hostgroup_members hgm on hgm.host_object_id = oh.id}
 			${if_table:hg,hgm,oh:inner join ${TABLE_PREFIX}hostgroups hg on hg.id = hgm.hostgroup_id}
 			${if_table:ohg,hg,hgm,oh:inner join ${TABLE_PREFIX}objects ohg on ohg.id = hg.hostgroup_object_id}
-			${if_table:cvsh,oh:inner join ${TABLE_PREFIX}customvariablestatus cvsh on oh.id = cvsh.id}
+			${if_table:cvsh,oh:inner join ${TABLE_PREFIX}customvariablestatus cvsh on oh.id = cvsh.object_id}
 			left join ${TABLE_PREFIX}objects osg on osg.id = h.host_object_id and osg.is_active = 1
 			
 			${FILTER}
@@ -297,8 +299,8 @@ class IcingaApiSearchIdoOci8
 			${if_table:hgm,oh,s,os:inner join ${TABLE_PREFIX}hostgroup_members hgm on hgm.host_object_id = oh.id}
 			${if_table:hg,hgm,oh,s,os:inner join ${TABLE_PREFIX}hostgroups hg on hg.id = hgm.hostgroup_id}
 			${if_table:ohg,hg,hgm,oh,s,os:inner join ${TABLE_PREFIX}objects ohg on ohg.id = hg.hostgroup_object_id}
-			${if_table:cvsh,oh,s,os:inner join ${TABLE_PREFIX}customvariablestatus cvsh on oh.id = cvsh.id}
-			${if_table:cvss,os:inner join ${TABLE_PREFIX}customvariablestatus cvss on os.id = cvss.id}
+			${if_table:cvsh,oh,s,os:inner join ${TABLE_PREFIX}customvariablestatus cvsh on oh.id = cvsh.object_id}
+			${if_table:cvss,os:inner join ${TABLE_PREFIX}customvariablestatus cvss on os.id = cvss.object_id}
 			left join ${TABLE_PREFIX}objects osg on os.id = s.service_object_id and osg.is_active = 1
 
 			${FILTER}
@@ -518,7 +520,7 @@ class IcingaApiSearchIdoOci8
 
 		// Customvariable data
 		'CUSTOMVARIABLE_ID' => array('cv', 'id'),
-		'CUSTOMVARIABLE_OBJECT_ID' => array('cv', 'id'),
+		'CUSTOMVARIABLE_OBJECT_ID' => array('cv', 'object_id'),
 		'CUSTOMVARIABLE_INSTANCE_ID' => array('cv', 'instance_id'),
 		'CUSTOMVARIABLE_NAME' => array('cv', 'varname'),
 		'CUSTOMVARIABLE_VALUE' => array('cv', 'varvalue'),





More information about the icinga-checkins mailing list