mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
parent
63e0549618
commit
705432b5fb
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
use Icinga\Module\Monitoring\Web\Widget\StateBadges;
|
use Icinga\Module\Monitoring\Web\Widget\StateBadges;
|
||||||
|
/** @var \Icinga\Module\Monitoring\DataView\Hostgroup $hostgroups */
|
||||||
if (! $this->compact): ?>
|
if (! $this->compact): ?>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<?= $this->tabs ?>
|
<?= $this->tabs ?>
|
||||||
@ -58,18 +58,19 @@ if (! $this->compact): ?>
|
|||||||
->setUrl('monitoring/list/hosts')
|
->setUrl('monitoring/list/hosts')
|
||||||
->add(
|
->add(
|
||||||
StateBadges::STATE_UP,
|
StateBadges::STATE_UP,
|
||||||
|
$hostgroup->hosts_up,
|
||||||
array(
|
array(
|
||||||
'host_state' => 0,
|
'host_state' => 0,
|
||||||
'hostgroup_name' => $hostgroup->hostgroup_name,
|
'hostgroup_name' => $hostgroup->hostgroup_name,
|
||||||
'sort' => 'host_severity'
|
'sort' => 'host_severity'
|
||||||
),
|
),
|
||||||
$hostgroup->hosts_up,
|
|
||||||
'List %u host that is currently in state UP in the host group "%s"',
|
'List %u host that is currently in state UP in the host group "%s"',
|
||||||
'List %u hosts which are currently in state UP in the host group "%s"',
|
'List %u hosts which are currently in state UP in the host group "%s"',
|
||||||
array($hostgroup->hosts_up, $hostgroup->hostgroup_alias)
|
array($hostgroup->hosts_up, $hostgroup->hostgroup_alias)
|
||||||
)
|
)
|
||||||
->add(
|
->add(
|
||||||
StateBadges::STATE_DOWN,
|
StateBadges::STATE_DOWN,
|
||||||
|
$hostgroup->hosts_down_unhandled,
|
||||||
array(
|
array(
|
||||||
'host_state' => 1,
|
'host_state' => 1,
|
||||||
'host_acknowledged' => 0,
|
'host_acknowledged' => 0,
|
||||||
@ -77,26 +78,26 @@ if (! $this->compact): ?>
|
|||||||
'hostgroup_name' => $hostgroup->hostgroup_name,
|
'hostgroup_name' => $hostgroup->hostgroup_name,
|
||||||
'sort' => 'host_severity'
|
'sort' => 'host_severity'
|
||||||
),
|
),
|
||||||
$hostgroup->hosts_down_unhandled,
|
|
||||||
'List %u host that is currently in state DOWN in the host group "%s"',
|
'List %u host that is currently in state DOWN in the host group "%s"',
|
||||||
'List %u hosts which are currently in state DOWN in the host group "%s"',
|
'List %u hosts which are currently in state DOWN in the host group "%s"',
|
||||||
array($hostgroup->hosts_down_unhandled, $hostgroup->hostgroup_alias)
|
array($hostgroup->hosts_down_unhandled, $hostgroup->hostgroup_alias)
|
||||||
)
|
)
|
||||||
->add(
|
->add(
|
||||||
StateBadges::STATE_DOWN_HANDLED,
|
StateBadges::STATE_DOWN_HANDLED,
|
||||||
|
$hostgroup->hosts_down_handled,
|
||||||
array(
|
array(
|
||||||
'host_state' => 1,
|
'host_state' => 1,
|
||||||
'host_handled' => 1,
|
'host_handled' => 1,
|
||||||
'hostgroup_name' => $hostgroup->hostgroup_name,
|
'hostgroup_name' => $hostgroup->hostgroup_name,
|
||||||
'sort' => 'host_severity'
|
'sort' => 'host_severity'
|
||||||
),
|
),
|
||||||
$hostgroup->hosts_down_handled,
|
|
||||||
'List %u host that is currently in state DOWN (Acknowledged) in the host group "%s"',
|
'List %u host that is currently in state DOWN (Acknowledged) in the host group "%s"',
|
||||||
'List %u hosts which are currently in state DOWN (Acknowledged) in the host group "%s"',
|
'List %u hosts which are currently in state DOWN (Acknowledged) in the host group "%s"',
|
||||||
array($hostgroup->hosts_down_handled, $hostgroup->hostgroup_alias)
|
array($hostgroup->hosts_down_handled, $hostgroup->hostgroup_alias)
|
||||||
)
|
)
|
||||||
->add(
|
->add(
|
||||||
StateBadges::STATE_UNREACHABLE,
|
StateBadges::STATE_UNREACHABLE,
|
||||||
|
$hostgroup->hosts_unreachable_unhandled,
|
||||||
array(
|
array(
|
||||||
'host_state' => 2,
|
'host_state' => 2,
|
||||||
'host_acknowledged' => 0,
|
'host_acknowledged' => 0,
|
||||||
@ -104,32 +105,31 @@ if (! $this->compact): ?>
|
|||||||
'hostgroup_name' => $hostgroup->hostgroup_name,
|
'hostgroup_name' => $hostgroup->hostgroup_name,
|
||||||
'sort' => 'host_severity'
|
'sort' => 'host_severity'
|
||||||
),
|
),
|
||||||
$hostgroup->hosts_unreachable_unhandled,
|
|
||||||
'List %u host that is currently in state UNREACHABLE in the host group "%s"',
|
'List %u host that is currently in state UNREACHABLE in the host group "%s"',
|
||||||
'List %u hosts which are currently in state UNREACHABLE in the host group "%s"',
|
'List %u hosts which are currently in state UNREACHABLE in the host group "%s"',
|
||||||
array($hostgroup->hosts_unreachable_unhandled, $hostgroup->hostgroup_alias)
|
array($hostgroup->hosts_unreachable_unhandled, $hostgroup->hostgroup_alias)
|
||||||
)
|
)
|
||||||
->add(
|
->add(
|
||||||
StateBadges::STATE_UNREACHABLE_HANDLED,
|
StateBadges::STATE_UNREACHABLE_HANDLED,
|
||||||
|
$hostgroup->hosts_unreachable_handled,
|
||||||
array(
|
array(
|
||||||
'host_state' => 2,
|
'host_state' => 2,
|
||||||
'host_handled' => 1,
|
'host_handled' => 1,
|
||||||
'hostgroup_name' => $hostgroup->hostgroup_name,
|
'hostgroup_name' => $hostgroup->hostgroup_name,
|
||||||
'sort' => 'host_severity'
|
'sort' => 'host_severity'
|
||||||
),
|
),
|
||||||
$hostgroup->hosts_unreachable_handled,
|
|
||||||
'List %u host that is currently in state UNREACHABLE (Acknowledged) in the host group "%s"',
|
'List %u host that is currently in state UNREACHABLE (Acknowledged) in the host group "%s"',
|
||||||
'List %u hosts which are currently in state UNREACHABLE (Acknowledged) in the host group "%s"',
|
'List %u hosts which are currently in state UNREACHABLE (Acknowledged) in the host group "%s"',
|
||||||
array($hostgroup->hosts_unreachable_handled, $hostgroup->hostgroup_alias)
|
array($hostgroup->hosts_unreachable_handled, $hostgroup->hostgroup_alias)
|
||||||
)
|
)
|
||||||
->add(
|
->add(
|
||||||
StateBadges::STATE_PENDING,
|
StateBadges::STATE_PENDING,
|
||||||
|
$hostgroup->hosts_pending,
|
||||||
array(
|
array(
|
||||||
'host_state' => 99,
|
'host_state' => 99,
|
||||||
'hostgroup_name' => $hostgroup->hostgroup_name,
|
'hostgroup_name' => $hostgroup->hostgroup_name,
|
||||||
'sort' => 'host_severity'
|
'sort' => 'host_severity'
|
||||||
),
|
),
|
||||||
$hostgroup->hosts_pending,
|
|
||||||
'List %u host that is currently in state PENDING in the host group "%s"',
|
'List %u host that is currently in state PENDING in the host group "%s"',
|
||||||
'List %u hosts which are currently in state PENDING in the host group "%s"',
|
'List %u hosts which are currently in state PENDING in the host group "%s"',
|
||||||
array($hostgroup->hosts_pending, $hostgroup->hostgroup_alias)
|
array($hostgroup->hosts_pending, $hostgroup->hostgroup_alias)
|
||||||
@ -155,18 +155,19 @@ if (! $this->compact): ?>
|
|||||||
->setUrl('monitoring/list/services')
|
->setUrl('monitoring/list/services')
|
||||||
->add(
|
->add(
|
||||||
StateBadges::STATE_OK,
|
StateBadges::STATE_OK,
|
||||||
|
$hostgroup->services_ok,
|
||||||
array(
|
array(
|
||||||
'service_state' => 0,
|
'service_state' => 0,
|
||||||
'hostgroup_name' => $hostgroup->hostgroup_name,
|
'hostgroup_name' => $hostgroup->hostgroup_name,
|
||||||
'sort' => 'service_severity'
|
'sort' => 'service_severity'
|
||||||
),
|
),
|
||||||
$hostgroup->services_ok,
|
|
||||||
'List %u service that is currently in state OK on hosts in the host group "%s"',
|
'List %u service that is currently in state OK on hosts in the host group "%s"',
|
||||||
'List %u services which are currently in state OK on hosts in the host group "%s"',
|
'List %u services which are currently in state OK on hosts in the host group "%s"',
|
||||||
array($hostgroup->services_ok, $hostgroup->hostgroup_alias)
|
array($hostgroup->services_ok, $hostgroup->hostgroup_alias)
|
||||||
)
|
)
|
||||||
->add(
|
->add(
|
||||||
StateBadges::STATE_CRITICAL,
|
StateBadges::STATE_CRITICAL,
|
||||||
|
$hostgroup->services_critical_unhandled,
|
||||||
array(
|
array(
|
||||||
'service_state' => 2,
|
'service_state' => 2,
|
||||||
'service_acknowledged' => 0,
|
'service_acknowledged' => 0,
|
||||||
@ -175,26 +176,26 @@ if (! $this->compact): ?>
|
|||||||
'hostgroup_name' => $hostgroup->hostgroup_name,
|
'hostgroup_name' => $hostgroup->hostgroup_name,
|
||||||
'sort' => 'service_severity'
|
'sort' => 'service_severity'
|
||||||
),
|
),
|
||||||
$hostgroup->services_critical_unhandled,
|
|
||||||
'List %u service that is currently in state CRITICAL on hosts in the host group "%s"',
|
'List %u service that is currently in state CRITICAL on hosts in the host group "%s"',
|
||||||
'List %u services which are currently in state CRITICAL on hosts in the host group "%s"',
|
'List %u services which are currently in state CRITICAL on hosts in the host group "%s"',
|
||||||
array($hostgroup->services_critical_unhandled, $hostgroup->hostgroup_alias)
|
array($hostgroup->services_critical_unhandled, $hostgroup->hostgroup_alias)
|
||||||
)
|
)
|
||||||
->add(
|
->add(
|
||||||
StateBadges::STATE_CRITICAL_HANDLED,
|
StateBadges::STATE_CRITICAL_HANDLED,
|
||||||
|
$hostgroup->services_critical_handled,
|
||||||
array(
|
array(
|
||||||
'service_state' => 2,
|
'service_state' => 2,
|
||||||
'service_handled' => 1,
|
'service_handled' => 1,
|
||||||
'hostgroup_name' => $hostgroup->hostgroup_name,
|
'hostgroup_name' => $hostgroup->hostgroup_name,
|
||||||
'sort' => 'service_severity'
|
'sort' => 'service_severity'
|
||||||
),
|
),
|
||||||
$hostgroup->services_critical_handled,
|
|
||||||
'List %u service that is currently in state CRITICAL (Acknowledged) on hosts in the host group "%s"',
|
'List %u service that is currently in state CRITICAL (Acknowledged) on hosts in the host group "%s"',
|
||||||
'List %u services which are currently in state CRITICAL (Acknowledged) on hosts in the host group "%s"',
|
'List %u services which are currently in state CRITICAL (Acknowledged) on hosts in the host group "%s"',
|
||||||
array($hostgroup->services_critical_unhandled, $hostgroup->hostgroup_alias)
|
array($hostgroup->services_critical_unhandled, $hostgroup->hostgroup_alias)
|
||||||
)
|
)
|
||||||
->add(
|
->add(
|
||||||
StateBadges::STATE_UNKNOWN,
|
StateBadges::STATE_UNKNOWN,
|
||||||
|
$hostgroup->services_unknown_unhandled,
|
||||||
array(
|
array(
|
||||||
'service_state' => 3,
|
'service_state' => 3,
|
||||||
'service_acknowledged' => 0,
|
'service_acknowledged' => 0,
|
||||||
@ -203,20 +204,19 @@ if (! $this->compact): ?>
|
|||||||
'hostgroup_name' => $hostgroup->hostgroup_name,
|
'hostgroup_name' => $hostgroup->hostgroup_name,
|
||||||
'sort' => 'service_severity'
|
'sort' => 'service_severity'
|
||||||
),
|
),
|
||||||
$hostgroup->services_unknown_unhandled,
|
|
||||||
'List %u service that is currently in state UNKNOWN on hosts in the host group "%s"',
|
'List %u service that is currently in state UNKNOWN on hosts in the host group "%s"',
|
||||||
'List %u services which are currently in state UNKNOWN on hosts in the host group "%s"',
|
'List %u services which are currently in state UNKNOWN on hosts in the host group "%s"',
|
||||||
array($hostgroup->services_unknown_unhandled, $hostgroup->hostgroup_alias)
|
array($hostgroup->services_unknown_unhandled, $hostgroup->hostgroup_alias)
|
||||||
)
|
)
|
||||||
->add(
|
->add(
|
||||||
StateBadges::STATE_UNKNOWN_HANDLED,
|
StateBadges::STATE_UNKNOWN_HANDLED,
|
||||||
|
$hostgroup->services_unknown_handled,
|
||||||
array(
|
array(
|
||||||
'service_state' => 3,
|
'service_state' => 3,
|
||||||
'service_handled' => 1,
|
'service_handled' => 1,
|
||||||
'hostgroup_name' => $hostgroup->hostgroup_name,
|
'hostgroup_name' => $hostgroup->hostgroup_name,
|
||||||
'sort' => 'service_severity'
|
'sort' => 'service_severity'
|
||||||
),
|
),
|
||||||
$hostgroup->services_unknown_handled,
|
|
||||||
'List %u service that is currently in state UNKNOWN (Acknowledged) on hosts in the host group "%s"',
|
'List %u service that is currently in state UNKNOWN (Acknowledged) on hosts in the host group "%s"',
|
||||||
'List %u services which are currently in state UNKNOWN (Acknowledged) on hosts in the host group "%s"',
|
'List %u services which are currently in state UNKNOWN (Acknowledged) on hosts in the host group "%s"',
|
||||||
array($hostgroup->services_unknown_handled, $hostgroup->hostgroup_alias)
|
array($hostgroup->services_unknown_handled, $hostgroup->hostgroup_alias)
|
||||||
@ -224,6 +224,7 @@ if (! $this->compact): ?>
|
|||||||
)
|
)
|
||||||
->add(
|
->add(
|
||||||
StateBadges::STATE_WARNING,
|
StateBadges::STATE_WARNING,
|
||||||
|
$hostgroup->services_warning_unhandled,
|
||||||
array(
|
array(
|
||||||
'service_state' => 1,
|
'service_state' => 1,
|
||||||
'service_acknowledged' => 0,
|
'service_acknowledged' => 0,
|
||||||
@ -232,32 +233,31 @@ if (! $this->compact): ?>
|
|||||||
'hostgroup_name' => $hostgroup->hostgroup_name,
|
'hostgroup_name' => $hostgroup->hostgroup_name,
|
||||||
'sort' => 'service_severity'
|
'sort' => 'service_severity'
|
||||||
),
|
),
|
||||||
$hostgroup->services_warning_unhandled,
|
|
||||||
'List %u service that is currently in state WARNING on hosts in the host group "%s"',
|
'List %u service that is currently in state WARNING on hosts in the host group "%s"',
|
||||||
'List %u services which are currently in state WARNING on hosts in the host group "%s"',
|
'List %u services which are currently in state WARNING on hosts in the host group "%s"',
|
||||||
array($hostgroup->services_warning_unhandled, $hostgroup->hostgroup_alias)
|
array($hostgroup->services_warning_unhandled, $hostgroup->hostgroup_alias)
|
||||||
)
|
)
|
||||||
->add(
|
->add(
|
||||||
StateBadges::STATE_WARNING_HANDLED,
|
StateBadges::STATE_WARNING_HANDLED,
|
||||||
|
$hostgroup->services_warning_handled,
|
||||||
array(
|
array(
|
||||||
'service_state' => 1,
|
'service_state' => 1,
|
||||||
'service_handled' => 1,
|
'service_handled' => 1,
|
||||||
'hostgroup_name' => $hostgroup->hostgroup_name,
|
'hostgroup_name' => $hostgroup->hostgroup_name,
|
||||||
'sort' => 'service_severity'
|
'sort' => 'service_severity'
|
||||||
),
|
),
|
||||||
$hostgroup->services_warning_handled,
|
|
||||||
'List %u service that is currently in state WARNING (Acknowledged) on hosts in the host group "%s"',
|
'List %u service that is currently in state WARNING (Acknowledged) on hosts in the host group "%s"',
|
||||||
'List %u services which are currently in state WARNING (Acknowledged) on hosts in the host group "%s"',
|
'List %u services which are currently in state WARNING (Acknowledged) on hosts in the host group "%s"',
|
||||||
array($hostgroup->services_warning_handled, $hostgroup->hostgroup_alias)
|
array($hostgroup->services_warning_handled, $hostgroup->hostgroup_alias)
|
||||||
)
|
)
|
||||||
->add(
|
->add(
|
||||||
StateBadges::STATE_PENDING,
|
StateBadges::STATE_PENDING,
|
||||||
|
$hostgroup->services_pending,
|
||||||
array(
|
array(
|
||||||
'service_state' => 99,
|
'service_state' => 99,
|
||||||
'hostgroup_name' => $hostgroup->hostgroup_name,
|
'hostgroup_name' => $hostgroup->hostgroup_name,
|
||||||
'sort' => 'service_severity'
|
'sort' => 'service_severity'
|
||||||
),
|
),
|
||||||
$hostgroup->services_pending,
|
|
||||||
'List %u service that is currently in state PENDING on hosts in the host group "%s"',
|
'List %u service that is currently in state PENDING on hosts in the host group "%s"',
|
||||||
'List %u services which are currently in state PENDING on hosts in the host group "%s"',
|
'List %u services which are currently in state PENDING on hosts in the host group "%s"',
|
||||||
array($hostgroup->services_pending, $hostgroup->hostgroup_alias)
|
array($hostgroup->services_pending, $hostgroup->hostgroup_alias)
|
||||||
|
@ -160,8 +160,8 @@ class StateBadges extends AbstractWidget
|
|||||||
* Add a state badge
|
* Add a state badge
|
||||||
*
|
*
|
||||||
* @param string $state
|
* @param string $state
|
||||||
* @param array $filter
|
|
||||||
* @param int $count
|
* @param int $count
|
||||||
|
* @param array $filter
|
||||||
* @param string $translateSingular
|
* @param string $translateSingular
|
||||||
* @param string $translatePlural
|
* @param string $translatePlural
|
||||||
* @param array $translateArgs
|
* @param array $translateArgs
|
||||||
@ -169,7 +169,7 @@ class StateBadges extends AbstractWidget
|
|||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function add(
|
public function add(
|
||||||
$state, array $filter, $count, $translateSingular, $translatePlural, array $translateArgs = array()
|
$state, $count, array $filter, $translateSingular, $translatePlural, array $translateArgs = array()
|
||||||
) {
|
) {
|
||||||
$this->badges[$state] = (object) array(
|
$this->badges[$state] = (object) array(
|
||||||
'count' => (int) $count,
|
'count' => (int) $count,
|
||||||
@ -218,7 +218,7 @@ class StateBadges extends AbstractWidget
|
|||||||
$groupItem = new NavigationItem(
|
$groupItem = new NavigationItem(
|
||||||
uniqid(),
|
uniqid(),
|
||||||
array(
|
array(
|
||||||
'name' => '',
|
'label' => '',
|
||||||
'priority' => $this->priority++
|
'priority' => $this->priority++
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user