Node: clear missing when setting state

This commit is contained in:
Thomas Gelf 2017-02-20 15:00:15 +01:00
parent 14e30e4741
commit 98bd02c164
2 changed files with 8 additions and 1 deletions

View file

@ -334,7 +334,13 @@ class BpNode extends Node
foreach ($this->getChildren() as $child) {
$bp->beginLoopDetection($this->name);
if ($child instanceof MonitoredNode && $child->isMissing()) {
$child->setState(self::ICINGA_UNKNOWN);
if ($child instanceof HostNode) {
$child->setState(self::ICINGA_UNREACHABLE);
} else {
$child->setState(self::ICINGA_UNKNOWN);
}
$child->setMissing();
}
$sort_states[] = $child->getSortingState();
$lastStateChange = max($lastStateChange, $child->getLastStateChange());

View file

@ -143,6 +143,7 @@ abstract class Node
public function setState($state)
{
$this->state = (int) $state;
$this->missing = false;
return $this;
}