From 643261c9f7b5e750fec1f92f1d37f6c2f9323be1 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 11 Jan 2017 16:55:05 +0100 Subject: [PATCH] NodeController: apply simulations to business... ...impact rendering --- application/controllers/NodeController.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/application/controllers/NodeController.php b/application/controllers/NodeController.php index d2dc8b6..2c7c444 100644 --- a/application/controllers/NodeController.php +++ b/application/controllers/NodeController.php @@ -4,6 +4,8 @@ namespace Icinga\Module\Businessprocess\Controllers; use Icinga\Module\Businessprocess\Renderer\Breadcrumb; use Icinga\Module\Businessprocess\Renderer\TileRenderer; +use Icinga\Module\Businessprocess\Simulation; +use Icinga\Module\Businessprocess\State\MonitoringState; use Icinga\Module\Businessprocess\Web\Controller; use Icinga\Module\Businessprocess\Web\Url; @@ -11,6 +13,7 @@ class NodeController extends Controller { public function impactAction() { + $this->setAutorefreshInterval(10); $content = $this->content(); $this->controls()->add( $this->singleTab($this->translate('Node Impact')) @@ -26,11 +29,18 @@ class NodeController extends Controller foreach ($config->getRootNodes() as $node) { $node->getState(); } + foreach ($config->getRootNodes() as $node) { + $node->clearState(); + } if (! $config->hasNode($name)) { continue; } + MonitoringState::apply($config); + $simulation = new Simulation($config, $this->session()); + $config->applySimulation($simulation); + foreach ($config->getNode($name)->getPaths() as $path) { $node = array_pop($path); $renderer = new TileRenderer($config, $config->getNode($node));