Skip to content

Commit

Permalink
VolatileStateResults: Add support for DependendencyNode objects
Browse files Browse the repository at this point in the history
  • Loading branch information
raviks789 committed Oct 30, 2024
1 parent dc08de2 commit 6f2e134
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion library/Icingadb/Redis/VolatileStateResults.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 6f2e134

Please sign in to comment.