Skip to content

Commit

Permalink
Hostgroups: Use query column hostgroup_name' instead of hostgroup'
Browse files Browse the repository at this point in the history
refs #8613
  • Loading branch information
Johannes Meyer committed Apr 10, 2015
1 parent e7c1e55 commit c59d5ac
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
Expand Up @@ -559,7 +559,7 @@ public function hostgroupsAction()
$this->addTitleTab('hostgroups', $this->translate('Host Groups'), $this->translate('List host groups'));
$this->setAutorefreshInterval(12);
$query = $this->backend->select()->from('groupsummary', array(
'hostgroup',
'hostgroup_name',
'hostgroup_alias',
'hosts_up',
'hosts_unreachable_handled',
Expand Down
22 changes: 11 additions & 11 deletions modules/monitoring/application/views/scripts/list/hostgroups.phtml
Expand Up @@ -28,7 +28,7 @@
</thead>
<tbody>
<?php foreach ($hostgroups as $h): ?>
<tr href="<?= $this->href('monitoring/list/hosts', array('hostgroup_name' => $h->hostgroup)) ?>">
<tr href="<?= $this->href('monitoring/list/hosts', array('hostgroup_name' => $h->hostgroup_name)) ?>">
<?php if ($h->services_critical_last_state_change_unhandled): ?>
<td class="state change critical unhandled">
<strong><?= $this->translate('CRITICAL'); ?></strong>
Expand Down Expand Up @@ -82,15 +82,15 @@
<?= $this->qlink(
$h->hostgroup_alias,
'monitoring/list/hosts',
array('hostgroup_name' => $h->hostgroup),
array('hostgroup_name' => $h->hostgroup_name),
array('title' => sprintf($this->translate('List all hosts in the group "%s"'), $h->hostgroup_alias))
); ?>
</td>
<td class="total">
<?= $this->qlink(
$h->services_total,
'monitoring/list/services',
array('hostgroup_name' => $h->hostgroup),
array('hostgroup_name' => $h->hostgroup_name),
array('title' => sprintf(
$this->translate('List all services of all hosts in host group "%s"'),
$h->hostgroup_alias
Expand All @@ -105,7 +105,7 @@
'monitoring/list/services',
array(
'service_state' => 0,
'hostgroup_name' => $h->hostgroup,
'hostgroup_name' => $h->hostgroup_name,
'sort' => 'service_severity'
),
array(
Expand All @@ -132,7 +132,7 @@
'service_acknowledged' => 0,
'service_in_downtime' => 0,
'host_problem' => 0,
'hostgroup_name' => $h->hostgroup,
'hostgroup_name' => $h->hostgroup_name,
'sort' => 'service_severity'
),
array(
Expand All @@ -156,7 +156,7 @@
array(
'service_state' => 2,
'service_handled' => 1,
'hostgroup_name' => $h->hostgroup,
'hostgroup_name' => $h->hostgroup_name,
'sort' => 'service_severity'
),
array(
Expand Down Expand Up @@ -186,7 +186,7 @@
'service_acknowledged' => 0,
'service_in_downtime' => 0,
'host_problem' => 0,
'hostgroup_name' => $h->hostgroup,
'hostgroup_name' => $h->hostgroup_name,
'sort' => 'service_severity'
),
array(
Expand All @@ -210,7 +210,7 @@
array(
'service_state' => 3,
'service_handled' => 1,
'hostgroup_name' => $h->hostgroup,
'hostgroup_name' => $h->hostgroup_name,
'sort' => 'service_severity'
),
array(
Expand Down Expand Up @@ -240,7 +240,7 @@
'service_acknowledged' => 0,
'service_in_downtime' => 0,
'host_problem' => 0,
'hostgroup_name' => $h->hostgroup,
'hostgroup_name' => $h->hostgroup_name,
'sort' => 'service_severity'
),
array(
Expand All @@ -264,7 +264,7 @@
array(
'service_state' => 1,
'service_handled' => 1,
'hostgroup_name' => $h->hostgroup,
'hostgroup_name' => $h->hostgroup_name,
'sort' => 'service_severity'
),
array(
Expand All @@ -291,7 +291,7 @@
'monitoring/list/services',
array(
'service_state' => 99,
'hostgroup_name' => $h->hostgroup,
'hostgroup_name' => $h->hostgroup_name,
'sort' => 'service_severity'
),
array(
Expand Down
Expand Up @@ -19,7 +19,7 @@ class GroupSummaryQuery extends IdoQuery
'hosts_down_handled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime != 0 THEN 1 ELSE 0 END)',
'hosts_down_unhandled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
'hosts_pending' => 'SUM(CASE WHEN object_type = \'host\' AND state = 99 THEN 1 ELSE 0 END)',
'hostgroup' => 'hostgroup',
'hostgroup_name' => 'hostgroup_name',
'hostgroup_alias' => 'hostgroup_alias'
),
'servicestatussummary' => array(
Expand Down Expand Up @@ -61,9 +61,9 @@ protected function joinBaseTables()
$columns[] = 'servicegroup_alias';
$groupColumns = array('servicegroup', 'servicegroup_alias');
} else {
$columns[] = 'hostgroup';
$columns[] = 'hostgroup_name';
$columns[] = 'hostgroup_alias';
$groupColumns = array('hostgroup', 'hostgroup_alias');
$groupColumns = array('hostgroup_name', 'hostgroup_alias');
}
$hosts = $this->createSubQuery(
'Hoststatus',
Expand Down
Expand Up @@ -83,7 +83,7 @@ class HoststatusQuery extends IdoQuery
END'
),
'hostgroups' => array(
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
'hostgroup_name' => 'hgo.name1',
'hostgroup_alias' => 'hg.alias'
),
'servicegroups' => array(
Expand Down
Expand Up @@ -15,7 +15,7 @@ public function getColumns()
return array(
'servicegroup',
'servicegroup_alias',
'hostgroup',
'hostgroup_name',
'hostgroup_alias',
'hosts_up',
'hosts_unreachable',
Expand Down

0 comments on commit c59d5ac

Please sign in to comment.