Fix Queries: Summaries, Host, Service

This commit is contained in:
Alexander Fuhr 2014-10-06 11:37:33 +02:00
parent 97d2a920db
commit a0122763a6
4 changed files with 9 additions and 4 deletions

View File

@ -44,7 +44,6 @@ class GroupSummaryQuery extends IdoQuery
$columns = array(
'object_type',
'host_state',
'host_name'
);
// Prepend group column since we'll use columns index 0 later for grouping
@ -61,6 +60,9 @@ class GroupSummaryQuery extends IdoQuery
'in_downtime' => 'host_in_downtime'
)
);
if (in_array('servicegroup', $this->desiredColumns)) {
$hosts->group(array('sgo.name1', 'ho.object_id', 'state', 'acknowledged', 'in_downtime'));
}
$services = $this->createSubQuery(
'Status',
$columns + array(

View File

@ -64,7 +64,8 @@ class HostStatus extends DataView
'host_percent_state_change',
'host_modified_host_attributes',
'host_severity',
'host_problem'
'host_problem',
'host_ipv4'
);
}
@ -105,7 +106,7 @@ class HostStatus extends DataView
public function getFilterColumns()
{
return array('hostgroup', 'service_problems');
return array('hostgroup', 'service_problems', 'servicegroup');
}
public function isValidFilterTarget($column)

View File

@ -101,6 +101,7 @@ class ServiceStatus extends DataView
'service_flap_detection_enabled',
'service_flap_detection_enabled_changed',
'service_modified_service_attributes',
'service_host_name'
);
}

View File

@ -191,7 +191,8 @@ class Service extends MonitoredObject
'service_flap_detection_enabled_changed',
'service_modified_service_attributes',
'service_process_performance_data',
'service_percent_state_change'
'service_percent_state_change',
'service_host_name'
))
->where('host_name', $this->host->getName())
->where('service_description', $this->service);