From 4852c7aec5f902848cc085a9accbdf58f5a2d4da Mon Sep 17 00:00:00 2001 From: Virsacer Date: Sat, 27 Jun 2020 18:24:23 +0200 Subject: [PATCH] Filter Services with no perfdata --- application/controllers/ListController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/application/controllers/ListController.php b/application/controllers/ListController.php index d98b521..c3e8fe6 100644 --- a/application/controllers/ListController.php +++ b/application/controllers/ListController.php @@ -2,6 +2,7 @@ namespace Icinga\Module\Graphite\Controllers; +use Icinga\Data\Filter\Filter; use Icinga\Module\Graphite\Forms\TimeRangePicker\TimeRangePickerTrait as TimeRangePicker; use Icinga\Module\Graphite\Forms\TimeRangePicker\TimeRangePickerTrait as TimeRangePickerFormTrait; use Icinga\Module\Graphite\Web\Controller\MonitoringAwareController; @@ -40,6 +41,8 @@ class ListController extends MonitoringAwareController $this->backend->select()->from('hoststatus', ['host_name']) ); + $hostsQuery->applyFilter(Filter::expression('host_perfdata', '!=', '')); + $this->view->baseUrl = $baseUrl = Url::fromPath('monitoring/host/show'); TimeRangePickerFormTrait::copyAllRangeParameters( $baseUrl->getParams(), @@ -76,6 +79,8 @@ class ListController extends MonitoringAwareController $this->backend->select()->from('servicestatus', ['host_name', 'service_description']) ); + $servicesQuery->applyFilter(Filter::expression('service_perfdata', '!=', '')); + $this->view->hostBaseUrl = $hostBaseUrl = Url::fromPath('monitoring/host/show'); TimeRangePickerFormTrait::copyAllRangeParameters( $hostBaseUrl->getParams(),