mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-06-09 08:42:05 -04:00
BpNode: provide also host state types in summary
This commit is contained in:
parent
4c9ed65a09
commit
bf5b3424be
1 changed files with 15 additions and 2 deletions
|
|
@ -20,6 +20,18 @@ class BpNode extends Node
|
|||
protected $counters;
|
||||
protected $missing = null;
|
||||
|
||||
protected static $emptyStateSummary = array(
|
||||
'OK' => 0,
|
||||
'WARNING' => 0,
|
||||
'CRITICAL' => 0,
|
||||
'UNKNOWN' => 0,
|
||||
'PENDING' => 0,
|
||||
'UP' => 0,
|
||||
'DOWN' => 0,
|
||||
'UNREACHABLE' => 0,
|
||||
'MISSING' => 0,
|
||||
);
|
||||
|
||||
protected static $sortStateInversionMap = array(
|
||||
4 => 0,
|
||||
3 => 0,
|
||||
|
|
@ -42,7 +54,8 @@ class BpNode extends Node
|
|||
{
|
||||
if ($this->counters === null) {
|
||||
$this->getState();
|
||||
$this->counters = array(0, 0, 0, 0, 99 => 0);
|
||||
$this->counters = self::$emptyStateSummary;
|
||||
|
||||
foreach ($this->children as $child) {
|
||||
if ($child instanceof BpNode) {
|
||||
$counters = $child->getStateSummary();
|
||||
|
|
@ -50,7 +63,7 @@ class BpNode extends Node
|
|||
$this->counters[$k] += $v;
|
||||
}
|
||||
} else {
|
||||
$state = $child->getState();
|
||||
$state = $child->getStateName();
|
||||
$this->counters[$state]++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue