Skip to content

Commit

Permalink
UnreachableParent: Don't include intermediate parents..
Browse files Browse the repository at this point in the history
..if they're unreachable themselves
  • Loading branch information
nilmerg committed Oct 8, 2024
1 parent b8498c7 commit 61dfa18
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions library/Icingadb/Model/UnreachableParent.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,14 @@ public static function on(Connection $db, Model $root = null): Query
self::selectNodes($db, $root),
'unreachable_parent',
true
)->where([
'unreachable_parent.level > ?' => 0,
'unreachable_parent.is_group_member = ?' => 0
]);
);

$query->filter(Filter::all(
Filter::greaterThan('level', 0),
Filter::equal('is_group_member', 0),
Filter::unequal('host.state.is_reachable', 'n'),
Filter::unequal('service.state.is_reachable', 'n')
));

return $query;
}
Expand Down

0 comments on commit 61dfa18

Please sign in to comment.