Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICMP doesn't work on Docker Linux #182

Closed
waywardone opened this issue Oct 7, 2021 · 8 comments
Closed

ICMP doesn't work on Docker Linux #182

waywardone opened this issue Oct 7, 2021 · 8 comments

Comments

@waywardone
Copy link

I'm using gatus in a docker container on a Linux host and find that all icmp tests fail - even for hosts that are up and reachable via ICMP. Other tests like TCP and HTTP work as expected. I noticed the changes related to pinger.SetPrivileged and have picked up the most recent image available but ICMP tests still fail. Here's my docker-compose:

   gatus:
     container_name: gatus
     hostname: gatus
     restart: unless-stopped
     image: twinproduction/gatus:latest
     ports:
       - 4008:8080
     volumes:
       - ${USERDIR}/docker/gatus/data:/data
       - ${USERDIR}/docker/gatus/config.yaml:/config/config.yaml
     environment:
         TZ: "${TZ}"

and here's an example configuration for icmp that fails (when it should not):

   - name: huginn
     group: my-network
     url: "icmp://google.com"
     interval: 1m
     conditions:
       - "[CONNECTED] == true"

gatus-icmp-test

A log entry for the test:

2021/10/07 02:53:15 [watchdog][execute] Monitored group=my-network; service=google; success=false; errors=0; duration=0s

Other things I've tried without any difference in behavior:

  • used IP addresses instead of names
  • configured ICMP test for 127.0.0.1
@TwiN
Copy link
Owner

TwiN commented Oct 7, 2021

Hello @waywardone,

Did it work prior to the recent changes on pinger.SetPrivileged?

@TwiN
Copy link
Owner

TwiN commented Oct 7, 2021

Yup I was able to reproduce it.
For some reason, it works on Linux, but not on Linux on Docker.

I'll do a quick fix for now.

@TwiN TwiN changed the title docker gatus on Linux host - ICMP tests failing ICMP doesn't work on Docker Linux Oct 7, 2021
@TwiN TwiN closed this as completed in c423afb Oct 7, 2021
@TwiN TwiN reopened this Oct 7, 2021
@TwiN
Copy link
Owner

TwiN commented Oct 7, 2021

Can you try latest and let me know?

@waywardone
Copy link
Author

Works as expected now. Thank you for the quick turnaround.

@sashkab
Copy link

sashkab commented Oct 7, 2021

Can confirm that with c423afb tests are passing in docker container, while they stopped in 3.2.0 and 3.2.1... Could you please consider rereleasing patch release with this fix?

Thanks!

@TwiN
Copy link
Owner

TwiN commented Oct 8, 2021

@sashkab Will do shortly, as I just changed my username and need to re-release every library I have 🤣

@TwiN
Copy link
Owner

TwiN commented Oct 8, 2021

Released in v3.2.2

@roughnecks
Copy link

Didn't want to open another issue but icmp-ping doesn't work with GO too.

I tried "google.com" which resolves to IPv6 on my host and also 1 of google.com's IPv4 - always fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants