Skip to content

Commit

Permalink
monitoring: Rearrange code in the HostdowntimeQuery
Browse files Browse the repository at this point in the history
refs #9956
  • Loading branch information
lippserd committed Sep 29, 2015
1 parent e4e0ad7 commit 0896589
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ class HostdowntimeQuery extends IdoQuery
* {@inheritdoc}
*/
protected $columnMap = array(
'instances' => array(
'instance_name' => 'i.instance_name'
),
'downtimes' => array(
'downtime_author' => 'sd.author_name COLLATE latin1_general_ci',
'downtime_author_name' => 'sd.author_name',
Expand Down Expand Up @@ -51,6 +48,9 @@ class HostdowntimeQuery extends IdoQuery
'hoststatus' => array(
'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END'
),
'instances' => array(
'instance_name' => 'i.instance_name'
),
'servicegroups' => array(
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
'servicegroup_name' => 'sgo.name1',
Expand Down Expand Up @@ -123,6 +123,18 @@ protected function joinHoststatus()
);
}

/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = sd.instance_id',
array()
);
}

/**
* Join service groups
*/
Expand Down Expand Up @@ -160,18 +172,6 @@ protected function joinServices()
);
}

/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = sd.instance_id',
array()
);
}

/**
* {@inheritdoc}
*/
Expand Down

0 comments on commit 0896589

Please sign in to comment.