2013-09-24 15:26:10 +02:00
|
|
|
<?php
|
2016-02-08 15:41:00 +01:00
|
|
|
/* Icinga Web 2 | (c) 2013 Icinga Development Team | GPLv2+ */
|
2013-09-24 15:26:10 +02:00
|
|
|
|
|
|
|
namespace Icinga\Module\Monitoring\DataView;
|
|
|
|
|
2013-10-14 13:25:25 +02:00
|
|
|
class ServiceStatus extends DataView
|
2013-09-24 15:26:10 +02:00
|
|
|
{
|
2014-10-08 12:30:08 +02:00
|
|
|
/**
|
2015-08-17 14:06:48 +02:00
|
|
|
* {@inheritdoc}
|
2013-09-24 15:26:10 +02:00
|
|
|
*/
|
|
|
|
public function getColumns()
|
|
|
|
{
|
2015-11-13 15:09:54 +01:00
|
|
|
return array_merge($this->getHookedColumns(), array(
|
2016-04-11 10:27:28 +02:00
|
|
|
'host_acknowledged',
|
|
|
|
'host_action_url',
|
|
|
|
'host_active_checks_enabled',
|
2013-09-24 15:26:10 +02:00
|
|
|
'host_address',
|
2015-07-16 10:35:28 +02:00
|
|
|
'host_address6',
|
2016-04-11 10:27:28 +02:00
|
|
|
'host_alias',
|
|
|
|
'host_check_source',
|
|
|
|
'host_display_name',
|
2013-09-24 15:26:10 +02:00
|
|
|
'host_handled',
|
2016-04-11 10:27:28 +02:00
|
|
|
'host_hard_state',
|
2013-09-24 15:26:10 +02:00
|
|
|
'host_in_downtime',
|
2016-04-11 10:27:28 +02:00
|
|
|
'host_ipv4',
|
2013-09-24 15:26:10 +02:00
|
|
|
'host_is_flapping',
|
|
|
|
'host_last_check',
|
|
|
|
'host_last_hard_state',
|
|
|
|
'host_last_hard_state_change',
|
2016-04-11 10:27:28 +02:00
|
|
|
'host_last_state_change',
|
2013-09-24 15:26:10 +02:00
|
|
|
'host_last_time_down',
|
|
|
|
'host_last_time_unreachable',
|
2016-04-11 10:27:28 +02:00
|
|
|
'host_last_time_up',
|
|
|
|
'host_long_output',
|
2013-10-20 13:15:11 +02:00
|
|
|
'host_modified_host_attributes',
|
2016-04-11 10:27:28 +02:00
|
|
|
'host_name',
|
|
|
|
'host_notes_url',
|
|
|
|
'host_notifications_enabled',
|
|
|
|
'host_output',
|
|
|
|
'host_passive_checks_enabled',
|
|
|
|
'host_perfdata',
|
|
|
|
'host_problem',
|
|
|
|
'host_severity',
|
|
|
|
'host_state',
|
|
|
|
'host_state_type',
|
|
|
|
'host_unhandled_service_count',
|
|
|
|
'instance_name',
|
|
|
|
'service_acknowledged',
|
|
|
|
'service_acknowledgement_type',
|
|
|
|
'service_action_url',
|
2013-10-15 19:56:33 +02:00
|
|
|
'service_active_checks_enabled',
|
2013-10-20 13:15:11 +02:00
|
|
|
'service_active_checks_enabled_changed',
|
2016-04-11 10:27:28 +02:00
|
|
|
'service_attempt',
|
|
|
|
'service_check_command',
|
|
|
|
'service_check_source',
|
|
|
|
'service_check_timeperiod',
|
|
|
|
'service_current_check_attempt',
|
|
|
|
'service_current_notification_number',
|
|
|
|
'service_description',
|
|
|
|
'service_display_name',
|
|
|
|
'service_event_handler_enabled',
|
|
|
|
'service_event_handler_enabled_changed',
|
|
|
|
'service_flap_detection_enabled',
|
|
|
|
'service_flap_detection_enabled_changed',
|
|
|
|
'service_handled',
|
|
|
|
'service_hard_state',
|
|
|
|
'service_host_name',
|
|
|
|
'service_in_downtime',
|
|
|
|
'service_is_flapping',
|
2016-04-11 10:28:12 +02:00
|
|
|
'service_is_reachable',
|
2016-04-11 10:27:28 +02:00
|
|
|
'service_last_check',
|
2013-09-24 15:26:10 +02:00
|
|
|
'service_last_hard_state',
|
|
|
|
'service_last_hard_state_change',
|
2016-04-11 10:27:28 +02:00
|
|
|
'service_last_notification',
|
|
|
|
'service_last_state_change',
|
2017-07-27 15:03:12 +02:00
|
|
|
'service_last_state_change_ts',
|
2013-09-24 15:26:10 +02:00
|
|
|
'service_last_time_critical',
|
2016-04-11 10:27:28 +02:00
|
|
|
'service_last_time_ok',
|
2013-09-24 15:26:10 +02:00
|
|
|
'service_last_time_unknown',
|
2016-04-11 10:27:28 +02:00
|
|
|
'service_last_time_warning',
|
|
|
|
'service_long_output',
|
2013-10-20 13:15:11 +02:00
|
|
|
'service_max_check_attempts',
|
2016-04-11 10:27:28 +02:00
|
|
|
'service_modified_service_attributes',
|
|
|
|
'service_next_check',
|
|
|
|
'service_notes',
|
|
|
|
'service_notes_url',
|
|
|
|
'service_notifications_enabled',
|
|
|
|
'service_notifications_enabled_changed',
|
2013-10-20 13:15:11 +02:00
|
|
|
'service_obsessing',
|
|
|
|
'service_obsessing_changed',
|
2016-04-11 10:27:28 +02:00
|
|
|
'service_output',
|
|
|
|
'service_passive_checks_enabled',
|
|
|
|
'service_passive_checks_enabled_changed',
|
|
|
|
'service_perfdata',
|
|
|
|
'service_problem',
|
|
|
|
'service_severity',
|
|
|
|
'service_state',
|
|
|
|
'service_state_type',
|
|
|
|
'service_unhandled'
|
2015-11-13 15:09:54 +01:00
|
|
|
));
|
2013-09-24 15:26:10 +02:00
|
|
|
}
|
|
|
|
|
2015-08-17 14:06:48 +02:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
2013-09-24 15:26:10 +02:00
|
|
|
public function getSortRules()
|
|
|
|
{
|
|
|
|
return array(
|
2015-03-13 17:19:56 +01:00
|
|
|
'service_display_name' => array(
|
|
|
|
'order' => self::SORT_ASC
|
|
|
|
),
|
2015-01-21 09:37:45 +01:00
|
|
|
'service_severity' => array(
|
2014-04-17 18:25:32 +02:00
|
|
|
'columns' => array(
|
2015-05-21 12:17:25 +02:00
|
|
|
'service_severity',
|
2017-07-27 15:03:12 +02:00
|
|
|
'service_last_state_change_ts DESC'
|
2015-05-21 12:17:25 +02:00
|
|
|
),
|
|
|
|
'order' => self::SORT_DESC
|
2013-09-24 15:26:10 +02:00
|
|
|
),
|
2015-12-21 10:33:21 +01:00
|
|
|
'service_last_state_change' => array(
|
2017-07-27 15:03:12 +02:00
|
|
|
'columns' => array(
|
|
|
|
'service_last_state_change_ts'
|
|
|
|
),
|
2015-12-21 10:33:21 +01:00
|
|
|
'order' => self::SORT_DESC
|
|
|
|
),
|
2015-03-13 17:13:52 +01:00
|
|
|
'host_severity' => array(
|
|
|
|
'columns' => array(
|
2015-05-21 12:17:25 +02:00
|
|
|
'host_severity',
|
2015-05-15 10:54:30 +02:00
|
|
|
'host_last_state_change DESC',
|
2015-03-13 17:13:52 +01:00
|
|
|
'host_display_name ASC',
|
|
|
|
'service_display_name ASC'
|
2015-05-21 12:17:25 +02:00
|
|
|
),
|
|
|
|
'order' => self::SORT_DESC
|
2015-03-13 17:13:52 +01:00
|
|
|
),
|
2015-01-21 09:37:45 +01:00
|
|
|
'host_display_name' => array(
|
2013-09-24 15:26:10 +02:00
|
|
|
'columns' => array(
|
2015-01-21 09:37:45 +01:00
|
|
|
'host_display_name',
|
|
|
|
'service_display_name'
|
2013-09-24 15:26:10 +02:00
|
|
|
),
|
|
|
|
'order' => self::SORT_ASC
|
2014-02-18 20:42:18 +01:00
|
|
|
),
|
2015-01-21 09:37:45 +01:00
|
|
|
'host_address' => array(
|
2014-02-18 20:42:18 +01:00
|
|
|
'columns' => array(
|
2015-01-21 09:37:45 +01:00
|
|
|
'host_ipv4',
|
|
|
|
'service_display_name'
|
2014-02-18 20:42:18 +01:00
|
|
|
),
|
2015-01-21 09:37:45 +01:00
|
|
|
'order' => self::SORT_ASC
|
2013-09-24 15:26:10 +02:00
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-08-17 14:06:48 +02:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getStaticFilterColumns()
|
2013-09-24 15:26:10 +02:00
|
|
|
{
|
2015-04-09 11:41:56 +02:00
|
|
|
return array(
|
|
|
|
'host',
|
|
|
|
'hostgroup',
|
2015-06-05 15:49:26 +02:00
|
|
|
'hostgroup_alias',
|
2015-04-09 11:41:56 +02:00
|
|
|
'hostgroup_name',
|
|
|
|
'service',
|
|
|
|
'service_host',
|
|
|
|
'servicegroup',
|
2015-06-05 15:49:26 +02:00
|
|
|
'servicegroup_alias',
|
2015-04-09 11:41:56 +02:00
|
|
|
'servicegroup_name'
|
|
|
|
);
|
2013-09-24 15:26:10 +02:00
|
|
|
}
|
|
|
|
|
2015-05-19 17:50:07 +02:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getSearchColumns()
|
|
|
|
{
|
2015-10-01 18:48:36 +02:00
|
|
|
return array('service', 'service_display_name');
|
2015-05-19 17:50:07 +02:00
|
|
|
}
|
2013-09-24 15:26:10 +02:00
|
|
|
}
|