[icinga-checkins] icinga.org: icinga-api/cdoebler/default: * added custom variables to host and service queries (oracle)

git at icinga.org git at icinga.org
Tue Jan 12 15:47:05 CET 2010


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

Author: Christian Doebler <christian.doebler at netways.de>
Date:   Tue Jan 12 15:44:38 2010 +0100

* added custom variables to host and service queries (oracle)

---

 .../data_interfaces/IcingaApiSearchIdoOci.php      |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/objects/search/data_interfaces/IcingaApiSearchIdoOci.php b/objects/search/data_interfaces/IcingaApiSearchIdoOci.php
index dba652c..132daf4 100644
--- a/objects/search/data_interfaces/IcingaApiSearchIdoOci.php
+++ b/objects/search/data_interfaces/IcingaApiSearchIdoOci.php
@@ -50,6 +50,7 @@ class IcingaApiSearchIdoOci
 			${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:cvh,oh:inner join ${TABLE_PREFIX}customvariables cvh on oh.id = cvh.object_id}
 			where
 				oh.objecttype_id = 1
 			${FILTER}
@@ -77,6 +78,8 @@ class IcingaApiSearchIdoOci
 			${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:cvh,oh,s:inner join ${TABLE_PREFIX}customvariables cvh on oh.id = cvh.object_id}
+			${if_table:cvs:inner join ${TABLE_PREFIX}customvariables cvs on os.id = cvs.object_id}
 			where
 				os.objecttype_id = 2
 			${FILTER}
@@ -193,11 +196,10 @@ class IcingaApiSearchIdoOci
 			${if_table:ocg,hcg,h,oh:-- inner join ${TABLE_PREFIX}objects ocg on ocg.id = hcg.contactgroup_object_id}
 			${if_table:cgm,cg,hcg,h,oh:-- inner join ${TABLE_PREFIX}contactgroup_members cgm on cgm.contactgroup_id = cg.id}
 			${if_table:oc,cgm,cg,hcg,h,oh:-- inner join ${TABLE_PREFIX}objects oc on oc.id = cgm.contact_object_id}
-			
 			${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:cvh,oh:inner join ${TABLE_PREFIX}customvariables cvh on oh.id = cvh.object_id}
 			where 1
 			${FILTER}
 			group by
@@ -222,7 +224,8 @@ class IcingaApiSearchIdoOci
 			${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:cvh,oh,s,os:inner join ${TABLE_PREFIX}customvariables cvh on oh.id = cvh.object_id}
+			${if_table:cvs,os:inner join ${TABLE_PREFIX}customvariables cvs on os.id = cvs.object_id}
 			where 1
 			${FILTER}
 			group by
@@ -239,6 +242,7 @@ class IcingaApiSearchIdoOci
 			${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:cvh,oh:inner join ${TABLE_PREFIX}customvariables cvh on oh.id = cvh.object_id}
 			where 1
 			${FILTER}
 			${GROUPBY}
@@ -256,6 +260,8 @@ class IcingaApiSearchIdoOci
 			${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:cvh,oh,s,os:inner join ${TABLE_PREFIX}customvariables cvh on oh.id = cvh.object_id}
+			${if_table:cvs,os:inner join ${TABLE_PREFIX}customvariables cvs on os.id = cvs.object_id}
 			where 1
 			${FILTER}
 			${GROUPBY}
@@ -432,7 +438,9 @@ class IcingaApiSearchIdoOci
 		'HOST_PARENT_NAME' => array('ohp', 'name1'),
 		'HOST_CHILD_OBJECT_ID' => array('oh', 'object_id'),
 		'HOST_CHILD_NAME' => array('oh', 'name1'),
-	
+		'HOST_CUSTOMVARIABLE_NAME' => array('cvh', 'varname'),
+		'HOST_CUSTOMVARIABLE_VALUE' => array('cvh', 'varvalue'),
+
 		// Service data
 		'SERVICE_ID' => array('s', 'id'),
 		'SERVICE_INSTANCE_ID' => array('s', 'instance_id'),
@@ -483,7 +491,9 @@ class IcingaApiSearchIdoOci
 		'SERVICE_LATENCY_MAX' => array('ss', 'latency', 'max(%s)'),
 		'SERVICE_ALL' => array('s', '*'),
 		'SERVICE_STATUS_ALL' => array('ss', '*'),
-	
+		'SERVICE_CUSTOMVARIABLE_NAME' => array('cvs', 'varname'),
+		'SERVICE_CUSTOMVARIABLE_VALUE' => array('cvs', 'varvalue'),
+
 		// Config vars
 		'CONFIG_VAR_ID' => array('cfv', 'id'),
 		'CONFIG_VAR_INSTANCE_ID' => array('cfv', 'instance_id'),





More information about the icinga-checkins mailing list