mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
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();
|
$groupedTables = array();
|
||||||
if ($this->hasJoinedVirtualTable('servicegroups')) {
|
if ($this->hasJoinedVirtualTable('servicegroups')) {
|
||||||
|
$group[] = 'ho.object_id';
|
||||||
|
$group[] = 'h.host_id';
|
||||||
|
$groupedTables['hosts'] = true;
|
||||||
$serviceGroupColumns = array_keys($this->columnMap['servicegroups']);
|
$serviceGroupColumns = array_keys($this->columnMap['servicegroups']);
|
||||||
$selectedServiceGroupColumns = array_intersect($serviceGroupColumns, array_keys($this->columns));
|
$selectedServiceGroupColumns = array_intersect($serviceGroupColumns, array_keys($this->columns));
|
||||||
if (! empty($selectedServiceGroupColumns)) {
|
if (! empty($selectedServiceGroupColumns)) {
|
||||||
$group[] = 'ho.object_id';
|
|
||||||
$group[] = 'h.host_id';
|
|
||||||
$group[] = 'sgo.object_id';
|
$group[] = 'sgo.object_id';
|
||||||
$group[] = 'sg.servicegroup_id';
|
$group[] = 'sg.servicegroup_id';
|
||||||
$groupedTables['hosts'] = true;
|
|
||||||
$groupedTables['servicegroups'] = true;
|
$groupedTables['servicegroups'] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($this->hasJoinedVirtualTable('hostgroups')) {
|
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']);
|
$hostGroupColumns = array_keys($this->columnMap['hostgroups']);
|
||||||
$selectedHostGroupColumns = array_intersect($hostGroupColumns, array_keys($this->columns));
|
$selectedHostGroupColumns = array_intersect($hostGroupColumns, array_keys($this->columns));
|
||||||
if (! empty($selectedHostGroupColumns)) {
|
if (! empty($selectedHostGroupColumns)) {
|
||||||
if (! isset($groupedTables['hosts'])) {
|
|
||||||
$group[] = 'ho.object_id';
|
|
||||||
$group[] = 'h.host_id';
|
|
||||||
$groupedTables['hosts'] = true;
|
|
||||||
}
|
|
||||||
$group[] = 'hgo.object_id';
|
$group[] = 'hgo.object_id';
|
||||||
$group[] = 'hg.hostgroup_id';
|
$group[] = 'hg.hostgroup_id';
|
||||||
$groupedTables['hostgroups'] = true;
|
$groupedTables['hostgroups'] = true;
|
||||||
|
@ -409,26 +409,26 @@ class ServicestatusQuery extends IdoQuery
|
|||||||
}
|
}
|
||||||
$groupedTables = array();
|
$groupedTables = array();
|
||||||
if ($this->hasJoinedVirtualTable('servicegroups')) {
|
if ($this->hasJoinedVirtualTable('servicegroups')) {
|
||||||
|
$group[] = 'so.object_id';
|
||||||
|
$group[] = 's.service_id';
|
||||||
|
$groupedTables['services'] = true;
|
||||||
$serviceGroupColumns = array_keys($this->columnMap['servicegroups']);
|
$serviceGroupColumns = array_keys($this->columnMap['servicegroups']);
|
||||||
$selectedServiceGroupColumns = array_intersect($serviceGroupColumns, array_keys($this->columns));
|
$selectedServiceGroupColumns = array_intersect($serviceGroupColumns, array_keys($this->columns));
|
||||||
if (! empty($selectedServiceGroupColumns)) {
|
if (! empty($selectedServiceGroupColumns)) {
|
||||||
$group[] = 'so.object_id';
|
|
||||||
$group[] = 's.service_id';
|
|
||||||
$group[] = 'sgo.object_id';
|
$group[] = 'sgo.object_id';
|
||||||
$group[] = 'sg.servicegroup_id';
|
$group[] = 'sg.servicegroup_id';
|
||||||
$groupedTables['services'] = true;
|
|
||||||
$groupedTables['servicegroups'] = true;
|
$groupedTables['servicegroups'] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($this->hasJoinedVirtualTable('hostgroups')) {
|
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']);
|
$hostGroupColumns = array_keys($this->columnMap['hostgroups']);
|
||||||
$selectedHostGroupColumns = array_intersect($hostGroupColumns, array_keys($this->columns));
|
$selectedHostGroupColumns = array_intersect($hostGroupColumns, array_keys($this->columns));
|
||||||
if (! empty($selectedHostGroupColumns)) {
|
if (! empty($selectedHostGroupColumns)) {
|
||||||
if (! isset($groupedTables['services'])) {
|
|
||||||
$group[] = 'so.object_id';
|
|
||||||
$group[] = 's.service_id';
|
|
||||||
$groupedTables['services'] = true;
|
|
||||||
}
|
|
||||||
$group[] = 'hgo.object_id';
|
$group[] = 'hgo.object_id';
|
||||||
$group[] = 'hg.hostgroup_id';
|
$group[] = 'hg.hostgroup_id';
|
||||||
$groupedTables['hostgroups'] = true;
|
$groupedTables['hostgroups'] = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user