Skip to content

Commit

Permalink
Fix Queries: Summaries, Host, Service
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Fuhr committed Oct 6, 2014
1 parent 97d2a92 commit a012276
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
Expand Up @@ -44,7 +44,6 @@ protected function joinBaseTables()
$columns = array(
'object_type',
'host_state',
'host_name'
);

// Prepend group column since we'll use columns index 0 later for grouping
Expand All @@ -61,6 +60,9 @@ protected function joinBaseTables()
'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(
Expand Down
5 changes: 3 additions & 2 deletions modules/monitoring/library/Monitoring/DataView/HostStatus.php
Expand Up @@ -64,7 +64,8 @@ public function getColumns()
'host_percent_state_change',
'host_modified_host_attributes',
'host_severity',
'host_problem'
'host_problem',
'host_ipv4'
);
}

Expand Down Expand Up @@ -105,7 +106,7 @@ public function getSortRules()

public function getFilterColumns()
{
return array('hostgroup', 'service_problems');
return array('hostgroup', 'service_problems', 'servicegroup');
}

public function isValidFilterTarget($column)
Expand Down
Expand Up @@ -101,6 +101,7 @@ public function getColumns()
'service_flap_detection_enabled',
'service_flap_detection_enabled_changed',
'service_modified_service_attributes',
'service_host_name'
);
}

Expand Down
3 changes: 2 additions & 1 deletion modules/monitoring/library/Monitoring/Object/Service.php
Expand Up @@ -191,7 +191,8 @@ protected function getDataView()
'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);
Expand Down

0 comments on commit a012276

Please sign in to comment.