2015-05-19 11:31:17 -04:00
|
|
|
<?php
|
2016-02-08 09:41:00 -05:00
|
|
|
/* Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */
|
2015-05-19 11:31:17 -04:00
|
|
|
|
|
|
|
|
namespace Icinga\Module\Monitoring\DataView;
|
|
|
|
|
|
2015-05-20 09:40:49 -04:00
|
|
|
/**
|
|
|
|
|
* Data view for the host group summary
|
|
|
|
|
*/
|
|
|
|
|
class Hostgroupsummary extends DataView
|
2015-05-19 11:31:17 -04:00
|
|
|
{
|
2015-05-20 09:40:49 -04:00
|
|
|
public function getColumns()
|
|
|
|
|
{
|
|
|
|
|
return array(
|
|
|
|
|
'hostgroup_alias',
|
|
|
|
|
'hostgroup_name',
|
|
|
|
|
'hosts_down_handled',
|
|
|
|
|
'hosts_down_unhandled',
|
|
|
|
|
'hosts_pending',
|
2018-04-04 04:05:27 -04:00
|
|
|
'hosts_severity',
|
2015-05-20 11:03:23 -04:00
|
|
|
'hosts_total',
|
2015-05-20 09:40:49 -04:00
|
|
|
'hosts_unreachable_handled',
|
|
|
|
|
'hosts_unreachable_unhandled',
|
|
|
|
|
'hosts_up',
|
|
|
|
|
'services_critical_handled',
|
|
|
|
|
'services_critical_unhandled',
|
|
|
|
|
'services_ok',
|
|
|
|
|
'services_pending',
|
|
|
|
|
'services_total',
|
|
|
|
|
'services_unknown_handled',
|
|
|
|
|
'services_unknown_unhandled',
|
|
|
|
|
'services_warning_handled',
|
|
|
|
|
'services_warning_unhandled'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-21 05:24:31 -04:00
|
|
|
public function getSearchColumns()
|
2015-05-20 09:37:24 -04:00
|
|
|
{
|
2017-11-08 09:40:43 -05:00
|
|
|
return array('hostgroup', 'hostgroup_alias');
|
2015-05-20 09:37:24 -04:00
|
|
|
}
|
2015-05-21 06:26:27 -04:00
|
|
|
|
|
|
|
|
public function getSortRules()
|
|
|
|
|
{
|
|
|
|
|
return array(
|
|
|
|
|
'hostgroup_alias' => array(
|
|
|
|
|
'order' => self::SORT_ASC
|
2018-04-04 04:05:27 -04:00
|
|
|
),
|
|
|
|
|
'hosts_severity' => array(
|
|
|
|
|
'columns' => array(
|
|
|
|
|
'hosts_severity',
|
|
|
|
|
'hostgroup_alias ASC'
|
|
|
|
|
),
|
|
|
|
|
'order' => self::SORT_DESC
|
2015-05-21 06:26:27 -04:00
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
2017-07-27 09:03:12 -04:00
|
|
|
|
|
|
|
|
public function getStaticFilterColumns()
|
|
|
|
|
{
|
|
|
|
|
return array(
|
|
|
|
|
'instance_name',
|
2019-09-26 07:47:56 -04:00
|
|
|
'host_contact', 'host_contactgroup', 'host_name',
|
2017-07-27 09:03:12 -04:00
|
|
|
'hostgroup',
|
2019-09-26 07:47:56 -04:00
|
|
|
'service_description',
|
|
|
|
|
'servicegroup_name'
|
2017-07-27 09:03:12 -04:00
|
|
|
);
|
|
|
|
|
}
|
2019-09-26 07:47:56 -04:00
|
|
|
|
|
|
|
|
public function getFilterColumns()
|
|
|
|
|
{
|
|
|
|
|
if ($this->filterColumns === null) {
|
|
|
|
|
$filterColumns = parent::getFilterColumns();
|
|
|
|
|
$diff = array_diff($filterColumns, $this->getColumns());
|
|
|
|
|
$this->filterColumns = array_merge($diff, [
|
|
|
|
|
'Hostgroup Name' => 'hostgroup_name',
|
|
|
|
|
'Hostgroup Alias' => 'hostgroup_alias'
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $this->filterColumns;
|
|
|
|
|
}
|
2015-05-19 11:31:17 -04:00
|
|
|
}
|