Skip to content

Commit

Permalink
Fix #182: Fix ICMP on Docker Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
TwiN committed Oct 7, 2021
1 parent 835f768 commit c423afb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,12 @@ func Ping(address string, config *Config) (bool, time.Duration) {
}
pinger.Count = 1
pinger.Timeout = config.Timeout
// Set the pinger's privileged mode to true for windows
// https://github.com/TwinProduction/gatus/issues/132
pinger.SetPrivileged(runtime.GOOS == "windows")
// Set the pinger's privileged mode to true for every GOOS except darwin
// See https://github.com/TwinProduction/gatus/issues/132
//
// 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()
if err != nil {
return false, 0
Expand Down

0 comments on commit c423afb

Please sign in to comment.