monitoring: Restrict the host overview and the host status summary

refs #9009
This commit is contained in:
Eric Lippmann 2015-06-03 14:16:22 +02:00
parent e9308e847a
commit 8f111406f3

View File

@ -66,10 +66,9 @@ class Monitoring_ListController extends Controller
$stateColumn = 'host_state';
$stateChangeColumn = 'host_last_state_change';
}
$this->addTitleTab('hosts', $this->translate('Hosts'), $this->translate('List hosts'));
$this->setAutorefreshInterval(10);
$query = $this->backend->select()->from('hostStatus', array_merge(array(
$query = $this->backend->select()->from('hoststatus', array_merge(array(
'host_icon_image',
'host_icon_image_alt',
'host_name',
@ -98,10 +97,9 @@ class Monitoring_ListController extends Controller
'host_max_check_attempts'
), $this->addColumns()));
$this->filterQuery($query);
$this->applyRestriction('monitoring/hosts/filter', $query);
$this->applyRestriction('monitoring/filter/objects', $query);
$this->view->hosts = $query;
$this->view->stats = $this->backend->select()->from('statusSummary', array(
$stats = $this->backend->select()->from('hoststatussummary', array(
'hosts_total',
'hosts_up',
'hosts_down',
@ -111,8 +109,9 @@ class Monitoring_ListController extends Controller
'hosts_unreachable_handled',
'hosts_unreachable_unhandled',
'hosts_pending',
))->getQuery()->fetchRow();
));
$this->applyRestriction('monitoring/filter/objects', $stats);
$this->view->stats = $stats->fetchRow();
$this->setupLimitControl();
$this->setupPaginationControl($this->view->hosts);
$this->setupSortControl(array(