From 5626597fae97b21142ee471e002b0fa4a0a05f62 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 8 Oct 2024 16:18:24 +0200 Subject: [PATCH] UnreachableParent: Don't include intermediate parents.. ..if they're unreachable themselves --- library/Icingadb/Model/UnreachableParent.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/library/Icingadb/Model/UnreachableParent.php b/library/Icingadb/Model/UnreachableParent.php index de3608a3c..e2582a135 100644 --- a/library/Icingadb/Model/UnreachableParent.php +++ b/library/Icingadb/Model/UnreachableParent.php @@ -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; }