Fix ICMP doesn't work on Mac OS
@@ -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
