monitoring: Fix grouping of host and service status when filtering for group columns
refs #9956
This commit is contained in:
parent
eff9249863
commit
8cea292745
|
@ -289,26 +289,26 @@ class HoststatusQuery extends IdoQuery
|
|||
}
|
||||
$groupedTables = array();
|
||||
if ($this->hasJoinedVirtualTable('servicegroups')) {
|
||||
$group[] = 'ho.object_id';
|
||||
$group[] = 'h.host_id';
|
||||
$groupedTables['hosts'] = true;
|
||||
$serviceGroupColumns = array_keys($this->columnMap['servicegroups']);
|
||||
$selectedServiceGroupColumns = array_intersect($serviceGroupColumns, array_keys($this->columns));
|
||||
if (! empty($selectedServiceGroupColumns)) {
|
||||
$group[] = 'ho.object_id';
|
||||
$group[] = 'h.host_id';
|
||||
$group[] = 'sgo.object_id';
|
||||
$group[] = 'sg.servicegroup_id';
|
||||
$groupedTables['hosts'] = true;
|
||||
$groupedTables['servicegroups'] = true;
|
||||
}
|
||||
}
|
||||
if ($this->hasJoinedVirtualTable('hostgroups')) {
|
||||
if (! isset($groupedTables['hosts'])) {
|
||||
$group[] = 'ho.object_id';
|
||||
$group[] = 'h.host_id';
|
||||
$groupedTables['hosts'] = true;
|
||||
}
|
||||
$hostGroupColumns = array_keys($this->columnMap['hostgroups']);
|
||||
$selectedHostGroupColumns = array_intersect($hostGroupColumns, array_keys($this->columns));
|
||||
if (! empty($selectedHostGroupColumns)) {
|
||||
if (! isset($groupedTables['hosts'])) {
|
||||
$group[] = 'ho.object_id';
|
||||
$group[] = 'h.host_id';
|
||||
$groupedTables['hosts'] = true;
|
||||
}
|
||||
$group[] = 'hgo.object_id';
|
||||
$group[] = 'hg.hostgroup_id';
|
||||
$groupedTables['hostgroups'] = true;
|
||||
|
|
|
@ -409,26 +409,26 @@ class ServicestatusQuery extends IdoQuery
|
|||
}
|
||||
$groupedTables = array();
|
||||
if ($this->hasJoinedVirtualTable('servicegroups')) {
|
||||
$group[] = 'so.object_id';
|
||||
$group[] = 's.service_id';
|
||||
$groupedTables['services'] = true;
|
||||
$serviceGroupColumns = array_keys($this->columnMap['servicegroups']);
|
||||
$selectedServiceGroupColumns = array_intersect($serviceGroupColumns, array_keys($this->columns));
|
||||
if (! empty($selectedServiceGroupColumns)) {
|
||||
$group[] = 'so.object_id';
|
||||
$group[] = 's.service_id';
|
||||
$group[] = 'sgo.object_id';
|
||||
$group[] = 'sg.servicegroup_id';
|
||||
$groupedTables['services'] = true;
|
||||
$groupedTables['servicegroups'] = true;
|
||||
}
|
||||
}
|
||||
if ($this->hasJoinedVirtualTable('hostgroups')) {
|
||||
if (! isset($groupedTables['services'])) {
|
||||
$group[] = 'so.object_id';
|
||||
$group[] = 's.service_id';
|
||||
$groupedTables['services'] = true;
|
||||
}
|
||||
$hostGroupColumns = array_keys($this->columnMap['hostgroups']);
|
||||
$selectedHostGroupColumns = array_intersect($hostGroupColumns, array_keys($this->columns));
|
||||
if (! empty($selectedHostGroupColumns)) {
|
||||
if (! isset($groupedTables['services'])) {
|
||||
$group[] = 'so.object_id';
|
||||
$group[] = 's.service_id';
|
||||
$groupedTables['services'] = true;
|
||||
}
|
||||
$group[] = 'hgo.object_id';
|
||||
$group[] = 'hg.hostgroup_id';
|
||||
$groupedTables['hostgroups'] = true;
|
||||
|
|
Loading…
Reference in New Issue