ServicestatusQuery: Add query column `instance_name'

refs #9943
This commit is contained in:
Johannes Meyer 2015-08-25 16:35:48 +02:00
parent ced671a408
commit 344dcf2cf7
2 changed files with 16 additions and 0 deletions

View File

@ -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
*/

View File

@ -11,6 +11,7 @@ class ServiceStatus extends DataView
public function getColumns()
{
return array(
'instance_name',
'host_name',
'host_display_name',
'host_state',