BpNode: set missing to unknown before fetching...

...sorting state

refs #105
This commit is contained in:
Thomas Gelf 2017-02-20 14:57:17 +01:00
parent 9750e13234
commit 14e30e4741

View file

@ -326,19 +326,19 @@ class BpNode extends Node
if (!$this->hasChildren()) {
// TODO: delegate this to operators, should mostly fail
$this->state = 3;
$this->setState(self::ICINGA_UNKNOWN);
$this->setMissing();
return $this;
}
foreach ($this->getChildren() as $child) {
$bp->beginLoopDetection($this->name);
$sort_states[] = $child->getSortingState();
$lastStateChange = max($lastStateChange, $child->getLastStateChange());
$bp->endLoopDetection($this->name);
if ($child instanceof MonitoredNode && $child->isMissing()) {
$child->setState(self::ICINGA_UNKNOWN);
}
$sort_states[] = $child->getSortingState();
$lastStateChange = max($lastStateChange, $child->getLastStateChange());
$bp->endLoopDetection($this->name);
}
$this->setLastStateChange($lastStateChange);