*historyQuery: Add query column `instance_name'

refs #9943
This commit is contained in:
Johannes Meyer 2015-08-25 16:37:58 +02:00
parent 344dcf2cf7
commit 6906ea89b7
8 changed files with 92 additions and 0 deletions

View File

@ -17,6 +17,9 @@ class HostcommenthistoryQuery extends IdoQuery
* {@inheritdoc}
*/
protected $columnMap = array(
'instances' => array(
'instance_name' => 'i.instance_name'
),
'commenthistory' => array(
'host' => 'ho.name1 COLLATE latin1_general_ci',
'host_name' => 'ho.name1',
@ -149,6 +152,18 @@ class HostcommenthistoryQuery extends IdoQuery
);
}
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = hch.instance_id',
array()
);
}
/**
* {@inheritdoc}
*/

View File

@ -17,6 +17,9 @@ class HostdowntimestarthistoryQuery extends IdoQuery
* {@inheritdoc}
*/
protected $columnMap = array(
'instances' => array(
'instance_name' => 'i.instance_name'
),
'downtimehistory' => array(
'host' => 'ho.name1 COLLATE latin1_general_ci',
'host_name' => 'ho.name1',
@ -158,6 +161,18 @@ class HostdowntimestarthistoryQuery extends IdoQuery
);
}
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = hdh.instance_id',
array()
);
}
/**
* {@inheritdoc}
*/

View File

@ -27,6 +27,9 @@ class HoststatehistoryQuery extends IdoQuery
* {@inheritdoc}
*/
protected $columnMap = array(
'instances' => array(
'instance_name' => 'i.instance_name'
),
'statehistory' => array(
'host' => 'ho.name1 COLLATE latin1_general_ci',
'host_name' => 'ho.name1',
@ -165,6 +168,18 @@ class HoststatehistoryQuery extends IdoQuery
);
}
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = hh.instance_id',
array()
);
}
/**
* {@inheritdoc}
*/

View File

@ -17,6 +17,9 @@ class ServicecommenthistoryQuery extends IdoQuery
* {@inheritdoc}
*/
protected $columnMap = array(
'instances' => array(
'instance_name' => 'i.instance_name'
),
'commenthistory' => array(
'host' => 'so.name1 COLLATE latin1_general_ci',
'host_name' => 'so.name1',
@ -147,6 +150,18 @@ class ServicecommenthistoryQuery extends IdoQuery
);
}
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = sch.instance_id',
array()
);
}
/**
* {@inheritdoc}
*/

View File

@ -17,6 +17,9 @@ class ServicedowntimestarthistoryQuery extends IdoQuery
* {@inheritdoc}
*/
protected $columnMap = array(
'instances' => array(
'instance_name' => 'i.instance_name'
),
'downtimehistory' => array(
'host' => 'so.name1 COLLATE latin1_general_ci',
'host_name' => 'so.name1',
@ -156,6 +159,18 @@ class ServicedowntimestarthistoryQuery extends IdoQuery
);
}
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = sdh.instance_id',
array()
);
}
/**
* {@inheritdoc}
*/

View File

@ -27,6 +27,9 @@ class ServicestatehistoryQuery extends IdoQuery
* {@inheritdoc}
*/
protected $columnMap = array(
'instances' => array(
'instance_name' => 'i.instance_name'
),
'statehistory' => array(
'host' => 'so.name1 COLLATE latin1_general_ci',
'host_name' => 'so.name1',
@ -163,6 +166,18 @@ class ServicestatehistoryQuery extends IdoQuery
);
}
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = sh.instance_id',
array()
);
}
/**
* {@inheritdoc}
*/

View File

@ -50,6 +50,7 @@ class Eventgrid extends DataView
public function getStaticFilterColumns()
{
return array(
'instance_name',
'host', 'host_alias',
'hostgroup', 'hostgroup_alias', 'hostgroup_name',
'service', 'service_host_name',

View File

@ -11,6 +11,7 @@ class EventHistory extends DataView
public function getColumns()
{
return array(
'instance_name',
'cnt_notification',
'cnt_hard_state',
'cnt_soft_state',