From aecca63e05bb179886bdb2652cb2fcc06b5447df Mon Sep 17 00:00:00 2001 From: TwiN Date: Sun, 28 Apr 2024 19:05:11 -0400 Subject: [PATCH] fix: Use privileged mode for ICMP only on Windows --- client/client.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/client/client.go b/client/client.go index 7a00a767..7190a47f 100644 --- a/client/client.go +++ b/client/client.go @@ -238,12 +238,8 @@ func Ping(address string, config *Config) (bool, time.Duration) { pinger := ping.New(address) pinger.Count = 1 pinger.Timeout = config.Timeout - // Set the pinger's privileged mode to true for every GOOS except darwin - // See https://github.com/TwiN/gatus/issues/132 - // - // Note that for this to work on Linux, Gatus must run with sudo privileges. - // See https://github.com/prometheus-community/pro-bing#linux - pinger.SetPrivileged(runtime.GOOS != "darwin") + // See https://github.com/TwiN/gatus/issues/132 and https://github.com/TwiN/gatus/issues/697 + pinger.SetPrivileged(runtime.GOOS == "windows") pinger.SetNetwork(config.Network) err := pinger.Run() if err != nil {