monitoring/controllers: filter-related cleanup

This commit is contained in:
Thomas Gelf 2014-06-17 13:48:26 +00:00
parent 1a91f0369e
commit a53f589a6b
2 changed files with 13 additions and 24 deletions

View File

@ -29,21 +29,12 @@
// {{{ICINGA_LICENSE_HEADER}}}
use Icinga\Module\Monitoring\Controller as MonitoringController;
use Icinga\Module\Monitoring\Backend;
use Icinga\Module\Monitoring\DataView\Runtimevariables as RuntimevariablesView;
use Icinga\Module\Monitoring\DataView\Programstatus as ProgramstatusView;
use Icinga\Module\Monitoring\DataView\Runtimesummary as RuntimesummaryView;
/**
* Display process information and global commands
*/
class Monitoring_ProcessController extends MonitoringController
{
/**
* @var \Icinga\Module\Monitoring\Backend
*/
public $backend;
/**
* Retrieve backend and hooks for this controller
*
@ -51,7 +42,6 @@ class Monitoring_ProcessController extends MonitoringController
*/
public function init()
{
$this->backend = Backend::createBackend($this->_getParam('backend'));
$this->getTabs()->add('info', array(
'title' => 'Process Info',
'url' =>'monitoring/process/info'
@ -66,9 +56,10 @@ class Monitoring_ProcessController extends MonitoringController
$this->getTabs()->activate('info');
$this->setAutorefreshInterval(10);
$this->view->programstatus = ProgramstatusView::fromRequest(
$this->_request
)->getQuery()->fetchRow();
// TODO: This one is broken right now, doublecheck default columns
$this->view->programstatus = $this->backend->select()
->from('programstatus')
->getQuery()->fetchRow();
$this->view->backendName = $this->backend->getDefaultBackendName();
}
@ -77,14 +68,13 @@ class Monitoring_ProcessController extends MonitoringController
{
$this->getTabs()->activate('performance');
$this->setAutorefreshInterval(10);
$this->view->runtimevariables = (object) RuntimevariablesView::fromRequest(
$this->_request,
array('varname', 'varvalue')
)->getQuery()->fetchPairs();
$this->view->runtimevariables = (object) $this->backend->select()
->from('runtimevariables', array('varname', 'varvalue'))
->getQuery()->fetchPairs();
$this->view->checkperformance = $query = RuntimesummaryView::fromRequest(
$this->_request
)->getQuery()->fetchAll();
$this->view->checkperformance = $this->backend->select()
->from('runtimesummary')
->getQuery()->fetchAll();
}
}

View File

@ -3,7 +3,6 @@
// {{{ICINGA_LICENSE_HEADER}}}
use Icinga\Module\Monitoring\Controller as MonitoringController;
use Icinga\Module\Monitoring\DataView\StatusSummary;
use Icinga\Web\Url;
class Monitoring_TacticalController extends MonitoringController
@ -14,12 +13,12 @@ class Monitoring_TacticalController extends MonitoringController
'tactical_overview',
array(
'title' => 'Tactical Overview',
'url' => Url::fromPath('monitoring/tactical')
'url' => Url::fromRequest()
)
)->activate('tactical_overview');
$this->view->statusSummary = StatusSummary::fromRequest(
$this->_request,
$this->view->statusSummary = $this->backend->select()->from(
'statusSummary',
array(
'hosts_up',
'hosts_pending',