setAllowedFilterColumns(array( 'host_name', 'hostgroup_name', 'instance_name', 'service_description', 'servicegroup_name', function ($c) { return preg_match('/^_(?:host|service)_/i', $c); } )); foreach (Auth::getInstance()->getRestrictions($name) as $filter) { if ($filter === '*') { return Filter::matchAny(); } try { $restriction->addFilter(Filter::fromQueryString($filter)); } catch (QueryException $e) { throw new ConfigurationError( mt( 'monitoring', 'Cannot apply restriction %s using the filter %s. You can only use the following columns: %s' ), $name, $filter, implode(', ', array( 'instance_name', 'host_name', 'hostgroup_name', 'service_description', 'servicegroup_name', '_(host|service)_' )), $e ); } } return $restriction; } }