diff --git a/modules/monitoring/library/Monitoring/DataView/DataView.php b/modules/monitoring/library/Monitoring/DataView/DataView.php index 50cd436fd..2afb046d5 100644 --- a/modules/monitoring/library/Monitoring/DataView/DataView.php +++ b/modules/monitoring/library/Monitoring/DataView/DataView.php @@ -4,6 +4,7 @@ namespace Icinga\Module\Monitoring\DataView; use IteratorAggregate; +use Icinga\Application\Hook; use Icinga\Data\ConnectionInterface; use Icinga\Data\Filter\Filter; use Icinga\Data\Filter\FilterMatch; @@ -122,6 +123,18 @@ abstract class DataView implements QueryInterface, SortRules, FilterColumns, Ite return $view; } + protected function getHookedColumns() + { + $columns = array(); + foreach (Hook::all('monitoring/dataviewExtension') as $hook) { + foreach ($hook->getAdditionalQueryColumns($this->getQueryName()) as $col) { + $columns[] = $col; + } + } + + return $columns; + } + // TODO: This is not the right place for this, move it away protected function applyUrlFilter($request = null) {