Merge pull request #139 from Icinga/missing-counters

BpNode: Count missing nodes in getStateSummary
This commit is contained in:
Eric Lippmann 2018-07-02 17:22:35 +02:00 committed by GitHub
commit 1c76e7a152
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,11 +68,16 @@ class BpNode extends Node
foreach ($counters as $k => $v) {
$this->counters[$k] += $v;
}
} elseif ($child->isMissing()) {
$this->counters['MISSING']++;
} else {
$state = $child->getStateName();
$this->counters[$state]++;
}
}
if (! $this->hasChildren()) {
$this->counters['MISSING']++;
}
}
return $this->counters;
}