From ced671a4080b9a1b334e7c89611af22f1b0e3d61 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 25 Aug 2015 16:35:35 +0200 Subject: [PATCH] HoststatusQuery: Add query column `instance_name' refs #9943 --- .../Backend/Ido/Query/HoststatusQuery.php | 15 +++++++++++++++ .../library/Monitoring/DataView/Hoststatus.php | 1 + 2 files changed, 16 insertions(+) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php index 968d5607e..1d15243db 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php @@ -16,6 +16,9 @@ class HoststatusQuery 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', @@ -237,6 +240,18 @@ class HoststatusQuery extends IdoQuery ); } + /** + * Join instances + */ + protected function joinInstances() + { + $this->select->join( + array('i' => $this->prefix . 'instances'), + 'i.instance_id = ho.instance_id', + array() + ); + } + /** * {@inheritdoc} */ diff --git a/modules/monitoring/library/Monitoring/DataView/Hoststatus.php b/modules/monitoring/library/Monitoring/DataView/Hoststatus.php index 8d7efb35d..05385763c 100644 --- a/modules/monitoring/library/Monitoring/DataView/Hoststatus.php +++ b/modules/monitoring/library/Monitoring/DataView/Hoststatus.php @@ -11,6 +11,7 @@ class HostStatus extends DataView public function getColumns() { return array( + 'instance_name', 'host_name', 'host_display_name', 'host_alias',