From af494c8adca909c7d5eb46d46e7273f4dad2d86c Mon Sep 17 00:00:00 2001 From: raviks789 Date: Wed, 23 Oct 2024 14:00:45 +0200 Subject: [PATCH] VolatileStateResults: Add support for `DependendencyNode` objects --- library/Icingadb/Redis/VolatileStateResults.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/library/Icingadb/Redis/VolatileStateResults.php b/library/Icingadb/Redis/VolatileStateResults.php index 089b93ca6..c56db2721 100644 --- a/library/Icingadb/Redis/VolatileStateResults.php +++ b/library/Icingadb/Redis/VolatileStateResults.php @@ -7,6 +7,7 @@ use Icinga\Application\Benchmark; use Icinga\Module\Icingadb\Common\Auth; use Icinga\Module\Icingadb\Common\IcingaRedis; +use Icinga\Module\Icingadb\Model\DependencyNode; use Icinga\Module\Icingadb\Model\Host; use Icinga\Module\Icingadb\Model\Service; use ipl\Orm\Query; @@ -108,7 +109,19 @@ protected function applyRedisUpdates($rows) $states = []; $hostStates = []; foreach ($rows as $row) { - if ($type === null) { + if ($row instanceof DependencyNode) { + if ($row->redundancy_group_id !== null) { + continue; + } elseif ($row->service_id !== null) { + $type = 'service'; + $row = $row->service; + } else { + $type = 'host'; + $row = $row->host; + } + + $behaviors = $this->resolver->getBehaviors($row->state); + } elseif ($type === null) { $behaviors = $this->resolver->getBehaviors($row->state); switch (true) {