From ea2c3611540ec53c94dbca392ce8bcb7fcb0acba Mon Sep 17 00:00:00 2001 From: Sven Rebhan <36194019+srebhan@users.noreply.github.com> Date: Wed, 5 Mar 2025 16:22:35 +0100 Subject: [PATCH] fix(inputs.net): Skip checks in containerized environments (#16580) --- plugins/inputs/net/net.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/inputs/net/net.go b/plugins/inputs/net/net.go index a65f4af20..2637c2e50 100644 --- a/plugins/inputs/net/net.go +++ b/plugins/inputs/net/net.go @@ -45,6 +45,11 @@ func (n *Net) Init() error { ) } + // So not use the interface list of the system if the HOST_PROC variable is + // set as the interfaces are determined by a syscall and therefore might + // differ especially in container environments. + n.skipChecks = os.Getenv("HOST_PROC") != "" + return nil }