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