mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-24 17:04:42 +01:00
Fix #182: Fix ICMP on Docker Linux
This commit is contained in:
parent
835f768337
commit
c423afb0bf
@ -85,9 +85,12 @@ func Ping(address string, config *Config) (bool, time.Duration) {
|
|||||||
}
|
}
|
||||||
pinger.Count = 1
|
pinger.Count = 1
|
||||||
pinger.Timeout = config.Timeout
|
pinger.Timeout = config.Timeout
|
||||||
// Set the pinger's privileged mode to true for windows
|
// Set the pinger's privileged mode to true for every GOOS except darwin
|
||||||
// https://github.com/TwinProduction/gatus/issues/132
|
// See https://github.com/TwinProduction/gatus/issues/132
|
||||||
pinger.SetPrivileged(runtime.GOOS == "windows")
|
//
|
||||||
|
// Note that for this to work on Linux, Gatus must run with sudo privileges.
|
||||||
|
// See https://github.com/go-ping/ping#linux
|
||||||
|
pinger.SetPrivileged(runtime.GOOS != "darwin")
|
||||||
err = pinger.Run()
|
err = pinger.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, 0
|
return false, 0
|
||||||
|
Loading…
Reference in New Issue
Block a user