2013-10-15 19:56:33 +02:00
|
|
|
<?php
|
2015-02-04 10:46:36 +01:00
|
|
|
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
2013-10-15 19:56:33 +02:00
|
|
|
|
|
|
|
namespace Icinga\Module\Monitoring\DataView;
|
|
|
|
|
|
|
|
/**
|
2015-06-05 14:42:11 +02:00
|
|
|
* Host group data view
|
2013-10-15 19:56:33 +02:00
|
|
|
*/
|
|
|
|
class Hostgroup extends DataView
|
|
|
|
{
|
|
|
|
/**
|
2015-06-05 14:42:11 +02:00
|
|
|
* {@inheritdoc}
|
2013-10-15 19:56:33 +02:00
|
|
|
*/
|
|
|
|
public function getColumns()
|
|
|
|
{
|
|
|
|
return array(
|
2015-04-10 15:21:18 +02:00
|
|
|
'hostgroup_alias',
|
2015-06-05 14:42:11 +02:00
|
|
|
'hostgroup_name'
|
2013-10-15 19:56:33 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-06-05 14:42:11 +02:00
|
|
|
* {@inheritdoc}
|
2013-10-15 19:56:33 +02:00
|
|
|
*/
|
2015-06-05 14:42:11 +02:00
|
|
|
public function getFilterColumns()
|
2013-10-15 19:56:33 +02:00
|
|
|
{
|
|
|
|
return array(
|
2015-06-05 14:42:11 +02:00
|
|
|
'host', 'host_alias', 'host_display_name', 'host_name',
|
|
|
|
'hostgroup',
|
|
|
|
'service', 'service_description', 'service_display_name',
|
|
|
|
'servicegroup', 'servicegroup_alias', 'servicegroup_name'
|
2013-10-15 19:56:33 +02:00
|
|
|
);
|
|
|
|
}
|
2015-04-10 15:21:18 +02:00
|
|
|
|
2015-06-05 14:42:11 +02:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function isValidFilterTarget($column)
|
2015-04-10 15:21:18 +02:00
|
|
|
{
|
2015-06-05 14:42:11 +02:00
|
|
|
if ($column[0] === '_'
|
|
|
|
&& preg_match('/^_(?:host|service)_/', $column)
|
|
|
|
) {
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return parent::isValidFilterTarget($column);
|
|
|
|
}
|
2015-04-10 15:21:18 +02:00
|
|
|
}
|
2013-10-15 19:56:33 +02:00
|
|
|
}
|