diff --git a/library/Icingadb/Model/UnreachableParent.php b/library/Icingadb/Model/UnreachableParent.php index 6ba633aac..9ceaa6517 100644 --- a/library/Icingadb/Model/UnreachableParent.php +++ b/library/Icingadb/Model/UnreachableParent.php @@ -96,10 +96,20 @@ 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::any( + Filter::equal('service.state.affects_children', 'y'), + Filter::all( + Filter::unlike('service_id', '*'), + Filter::equal('host.state.affects_children', 'y') + ), + Filter::equal('redundancy_group.state.failed', 'y') + ) + )); return $query; }