From 369c52dfd4f86f1dcf8ba90c5c065286fce2b3ed Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 16 Feb 2017 13:35:28 +0100 Subject: [PATCH] ImportedNode: use MonitoringState fixes #108 --- library/Businessprocess/ImportedNode.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/library/Businessprocess/ImportedNode.php b/library/Businessprocess/ImportedNode.php index 79d956e..6634734 100644 --- a/library/Businessprocess/ImportedNode.php +++ b/library/Businessprocess/ImportedNode.php @@ -4,6 +4,7 @@ namespace Icinga\Module\Businessprocess; use Icinga\Application\Config; use Icinga\Module\Businessprocess\Html\Link; +use Icinga\Module\Businessprocess\State\MonitoringState; use Icinga\Module\Businessprocess\Storage\LegacyStorage; use Icinga\Module\Businessprocess\Web\Url; use Exception; @@ -66,12 +67,14 @@ class ImportedNode extends Node { if ($this->state === null) { try { - $this->importedConfig()->retrieveStatesFromBackend(); + MonitoringState::apply($this->importedConfig()); } catch (Exception $e) { } $this->state = $this->importedNode()->getState(); + $this->setMissing(false); } + return $this->state; } @@ -168,6 +171,9 @@ class ImportedNode extends Node } } + /** + * @return BpConfig + */ protected function importedConfig() { if ($this->config === null) {