From c59d5ac7d51e3d3c601a4b281d5ffa537856bd1b Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 16:28:33 +0200 Subject: [PATCH] Hostgroups: Use query column `hostgroup_name' instead of `hostgroup' refs #8613 --- .../controllers/ListController.php | 2 +- .../views/scripts/list/hostgroups.phtml | 22 +++++++++---------- .../Backend/Ido/Query/GroupsummaryQuery.php | 6 ++--- .../Backend/Ido/Query/HoststatusQuery.php | 2 +- .../Monitoring/DataView/Groupsummary.php | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index f0eb7e5fa8..82f3febb41 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -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', diff --git a/modules/monitoring/application/views/scripts/list/hostgroups.phtml b/modules/monitoring/application/views/scripts/list/hostgroups.phtml index 94086f446c..1e3eb29acf 100644 --- a/modules/monitoring/application/views/scripts/list/hostgroups.phtml +++ b/modules/monitoring/application/views/scripts/list/hostgroups.phtml @@ -28,7 +28,7 @@ - + services_critical_last_state_change_unhandled): ?> translate('CRITICAL'); ?> @@ -82,7 +82,7 @@ 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)) ); ?> @@ -90,7 +90,7 @@ 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 @@ -105,7 +105,7 @@ 'monitoring/list/services', array( 'service_state' => 0, - 'hostgroup_name' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup_name, 'sort' => 'service_severity' ), array( @@ -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( @@ -156,7 +156,7 @@ array( 'service_state' => 2, 'service_handled' => 1, - 'hostgroup_name' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup_name, 'sort' => 'service_severity' ), array( @@ -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( @@ -210,7 +210,7 @@ array( 'service_state' => 3, 'service_handled' => 1, - 'hostgroup_name' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup_name, 'sort' => 'service_severity' ), array( @@ -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( @@ -264,7 +264,7 @@ array( 'service_state' => 1, 'service_handled' => 1, - 'hostgroup_name' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup_name, 'sort' => 'service_severity' ), array( @@ -291,7 +291,7 @@ 'monitoring/list/services', array( 'service_state' => 99, - 'hostgroup_name' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup_name, 'sort' => 'service_severity' ), array( diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php index 867da7e78a..84023b9712 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php @@ -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( @@ -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', diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php index d9b4f2892e..d280c7a809 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php @@ -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( diff --git a/modules/monitoring/library/Monitoring/DataView/Groupsummary.php b/modules/monitoring/library/Monitoring/DataView/Groupsummary.php index bd74aebf2a..f4b0cfac83 100644 --- a/modules/monitoring/library/Monitoring/DataView/Groupsummary.php +++ b/modules/monitoring/library/Monitoring/DataView/Groupsummary.php @@ -15,7 +15,7 @@ public function getColumns() return array( 'servicegroup', 'servicegroup_alias', - 'hostgroup', + 'hostgroup_name', 'hostgroup_alias', 'hosts_up', 'hosts_unreachable',