From 344dcf2cf792080c373a8cbd74626286eb718ca3 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 25 Aug 2015 16:35:48 +0200 Subject: [PATCH] ServicestatusQuery: Add query column `instance_name' refs #9943 --- .../Backend/Ido/Query/ServicestatusQuery.php | 15 +++++++++++++++ .../library/Monitoring/DataView/Servicestatus.php | 1 + 2 files changed, 16 insertions(+) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatusQuery.php index ce988e944..c5fc6e755 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatusQuery.php @@ -19,6 +19,9 @@ class ServicestatusQuery extends IdoQuery * {@inheritdoc} */ protected $columnMap = array( + 'instances' => array( + 'instance_name' => 'i.instance_name' + ), 'hostgroups' => array( 'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci', 'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci', @@ -280,6 +283,18 @@ class ServicestatusQuery extends IdoQuery $this->joinedVirtualTables['services'] = true; } + /** + * Join instances + */ + protected function joinInstances() + { + $this->select->join( + array('i' => $this->prefix . 'instances'), + 'i.instance_id = so.instance_id', + array() + ); + } + /** * Join host groups */ diff --git a/modules/monitoring/library/Monitoring/DataView/Servicestatus.php b/modules/monitoring/library/Monitoring/DataView/Servicestatus.php index c60152049..ff68474f1 100644 --- a/modules/monitoring/library/Monitoring/DataView/Servicestatus.php +++ b/modules/monitoring/library/Monitoring/DataView/Servicestatus.php @@ -11,6 +11,7 @@ class ServiceStatus extends DataView public function getColumns() { return array( + 'instance_name', 'host_name', 'host_display_name', 'host_state',