Skip to content

Commit

Permalink
monitoring: Add StateBadges::STATE_DOWN*
Browse files Browse the repository at this point in the history
refs #5543
  • Loading branch information
lippserd committed Sep 27, 2015
1 parent 9115e1d commit 56fff33
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Expand Up @@ -69,7 +69,7 @@ if (! $this->compact): ?>
array($hostgroup->hosts_up, $hostgroup->hostgroup_alias)
)
->add(
StateBadges::STATE_CRITICAL,
StateBadges::STATE_DOWN,
array(
'host_state' => 1,
'host_acknowledged' => 0,
Expand All @@ -83,7 +83,7 @@ if (! $this->compact): ?>
array($hostgroup->hosts_down_unhandled, $hostgroup->hostgroup_alias)
)
->add(
StateBadges::STATE_CRITICAL_HANDLED,
StateBadges::STATE_DOWN_HANDLED,
array(
'host_state' => 1,
'host_handled' => 1,
Expand Down
13 changes: 12 additions & 1 deletion modules/monitoring/library/Monitoring/Web/Widget/StateBadges.php
Expand Up @@ -17,6 +17,10 @@ class StateBadges extends AbstractWidget

const STATE_CRITICAL_HANDLED = 'state-critical-handled';

const STATE_DOWN = 'state-down';

const STATE_DOWN_HANDLED = 'state-down-handled';

const STATE_OK = 'state-ok';

const STATE_PENDING = 'state-pending';
Expand Down Expand Up @@ -124,12 +128,19 @@ public function render()
array(static::STATE_CRITICAL, static::STATE_CRITICAL_HANDLED),
$badges
)
->createBadgeGroup(
array(static::STATE_DOWN, static::STATE_DOWN_HANDLED),
$badges
)
->createBadgeGroup(
array(static::STATE_UNREACHABLE, static::STATE_UNREACHABLE_HANDLED),
$badges
)
->createBadge(static::STATE_UNKNOWN, $badges)
->createBadge(static::STATE_PENDING, $badges);
return $badges->getRenderer()->setCssClass(static::CSS_CLASS)->render();
return $badges
->getRenderer()
->setCssClass(static::CSS_CLASS)
->render();
}
}

0 comments on commit 56fff33

Please sign in to comment.