icingaweb2-module-graphite/library/Graphite/Web/Controller/MonitoringAwareController.php
Sukhwinder Dhillon 1d13b16592 MonitoringAwareController: Don't initialize the monitoring backend if not required
If icingadb is set as backend, monitoring backend is not needed.
2022-03-11 15:27:34 +01:00

34 lines
907 B
PHP

<?php
namespace Icinga\Module\Graphite\Web\Controller;
use Icinga\Application\Modules\Module;
use Icinga\Module\Graphite\ProvidedHook\Icingadb\IcingadbSupport;
use Icinga\Module\Monitoring\Controller;
use Icinga\Module\Monitoring\DataView\DataView;
abstract class MonitoringAwareController extends Controller
{
/**
* Restrict the given monitored object query for the currently authenticated user
*
* @param DataView $dataView
*
* @return DataView The given data view
*/
protected function applyMonitoringRestriction(DataView $dataView)
{
$this->applyRestriction('monitoring/filter/objects', $dataView);
return $dataView;
}
protected function moduleInit()
{
if (Module::exists('icingadb') && IcingadbSupport::useIcingaDbAsBackend()) {
return;
}
parent::moduleInit();
}
}