Skip to content

Commit

Permalink
monitoring: Remove HostdowntimestarthistoryQuery::getGroup()
Browse files Browse the repository at this point in the history
refs #9956
  • Loading branch information
lippserd committed Sep 29, 2015
1 parent df69755 commit 956c86d
Showing 1 changed file with 16 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ class HostdowntimestarthistoryQuery extends IdoQuery
*/
protected $allowCustomVars = true;

/**
* {@inheritdoc}
*/
protected $groupBase = array('downtimehistory' => array('hdh.downtimehistory_id', 'ho.object_id'));

/**
* {@inheritdoc}
*/
protected $groupOrigin = array('hostgroups', 'services');

/**
* {@inheritdoc}
*/
Expand All @@ -23,14 +33,12 @@ class HostdowntimestarthistoryQuery extends IdoQuery
'downtimehistory' => array(
'host' => 'ho.name1 COLLATE latin1_general_ci',
'host_name' => 'ho.name1',
'object_type' => '(\'host\')'
),
'history' => array(
'type' => "('dt_start')",
'timestamp' => 'UNIX_TIMESTAMP(hdh.actual_start_time)',
'object_id' => 'hdh.object_id',
'state' => '(-1)',
'output' => "('[' || hdh.author_name || '] ' || hdh.comment_data)",
'object_id' => 'hdh.object_id',
'object_type' => '(\'host\')',
'output' => "('[' || hdh.author_name || '] ' || hdh.comment_data)",
'state' => '(-1)',
'timestamp' => 'UNIX_TIMESTAMP(hdh.actual_start_time)',
'type' => "('dt_start')"
),
'hostgroups' => array(
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
Expand Down Expand Up @@ -172,20 +180,4 @@ protected function joinInstances()
array()
);
}

/**
* {@inheritdoc}
*/
public function getGroup()
{
$group = array();
if ($this->hasJoinedVirtualTable('hostgroups') || $this->hasJoinedVirtualTable('services')) {
$group = array('hdh.downtimehistory_id', 'ho.object_id');
if ($this->hasJoinedVirtualTable('hosts')) {
$group[] = 'h.host_id';
}
}

return $group;
}
}

0 comments on commit 956c86d

Please sign in to comment.