From 43150ae4840bdcd0cc689bdf6536c0e0e1796c27 Mon Sep 17 00:00:00 2001 From: TwinProduction Date: Sun, 18 Jul 2021 20:43:44 -0400 Subject: [PATCH] Fix #132: ICMP doesn't work on Mac OS --- client/client.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/client.go b/client/client.go index bf703582..314f5e94 100644 --- a/client/client.go +++ b/client/client.go @@ -7,6 +7,7 @@ import ( "net" "net/http" "net/smtp" + "runtime" "strings" "time" @@ -107,7 +108,9 @@ func Ping(address string) (bool, time.Duration) { } pinger.Count = 1 pinger.Timeout = pingTimeout - pinger.SetPrivileged(true) + // Set the pinger's privileged mode to true for every operating system except darwin + // https://github.com/TwinProduction/gatus/issues/132 + pinger.SetPrivileged(runtime.GOOS != "darwin") err = pinger.Run() if err != nil { return false, 0