CLI/monitoring/list: fix DataView-related exception

This uses the renamed DataView serviceStatus instead of the former
status and fixes the problem that CLI still assumed to have fetch
and count function on the DataView.

fixes #6777
This commit is contained in:
Thomas Gelf 2014-07-31 17:24:56 +02:00
parent 8f729bfb65
commit 96925487bd
1 changed files with 3 additions and 1 deletions

View File

@ -72,6 +72,7 @@ class ListCommand extends Command
protected function showFormatted($query, $format, $columns)
{
$query = $query->getQuery();
switch($format) {
case 'json':
echo json_encode($query->fetchAll());
@ -155,7 +156,7 @@ class ListCommand extends Command
'service_perfdata',
'service_last_state_change'
);
$query = $this->getQuery('status', $columns)
$query = $this->getQuery('serviceStatus', $columns)
->order('host_name');
echo $this->renderStatusQuery($query);
}
@ -167,6 +168,7 @@ class ListCommand extends Command
$screen = $this->screen;
$utils = new CliUtils($screen);
$maxCols = $screen->getColumns();
$query = $query->getQuery();
$rows = $query->fetchAll();
$count = $query->count();
$count = count($rows);