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 does not work on Mac OS #132

Closed
xoraingroup opened this issue Jul 10, 2021 · 12 comments
Closed

ICMP does not work on Mac OS #132

xoraingroup opened this issue Jul 10, 2021 · 12 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@xoraingroup
Copy link

xoraingroup commented Jul 10, 2021

MAC OS Big Sur version 11.0.1

Everything works perfectly ok except icmp in MAC OS.

Config:

  • name: node-1
    url: "icmp://104.237.x.x"
    group: Uptime (Ping)
    conditions:
    • "[CONNECTED] == true"
    • "[RESPONSE_TIME] > 0"

image

the x.x is in ip is set intentionally.

Is this wrong config?

@TwiN
Copy link
Owner

TwiN commented Jul 10, 2021

I assume that the x.x is there to hide your IP -- can you try the following instead:

  - name: node-1
    group: Uptime (Ping)
    url: "icmp://127.0.0.1"
    conditions:
      - "[CONNECTED] == true"
      - "[RESPONSE_TIME] < 150"

@xoraingroup
Copy link
Author

xoraingroup commented Jul 10, 2021

Yes correct.

Tried and following are the results

image

Its not working even for localhost.

@TwiN
Copy link
Owner

TwiN commented Jul 10, 2021

When you say "on Mac OS", do you mean that you're running Gatus as an executable instead of going through Docker?

@xoraingroup
Copy link
Author

Yes thats correct. I am not using Docker.

@TwiN
Copy link
Owner

TwiN commented Jul 11, 2021

I don't have a Mac I can test this on, but this is likely where the culprit is:
https://github.com/TwinProduction/gatus/blob/9b68582622e5d20be48652ccc74440b279ad335e/client/client.go#L108-L111

Can you try running Gatus with elevated privileges, and see if the results are the same?
If that doesn't change anything, could you try to rebuild the executable after updating the boolean passed as parameter on L110 to false?

@xoraingroup
Copy link
Author

Yes you are right. With elevated privileges it works.

image

Ping should not need any elevated privileges. I think it might need a fix.

But its also good to know and you can at least mention in repo documentation for other people who might be facing such issue. The rest its awesome tool and thank you for this.

@xoraingroup
Copy link
Author

xoraingroup commented Jul 12, 2021

Also just rebuilt it with your instruction by setting pinger.SetPrivileged(false) and its working fine without sudo. Why did you put pinger.SetPrivileged(true) in the first place? Just curious to know.

@TwiN
Copy link
Owner

TwiN commented Jul 12, 2021

I believe it doesn't work on Windows (or was it Docker?) without pinger.SetPrivileged(true), but I'd have to double check.

Adding a conditional statement checking the value of GOOS should be able to resolve this issue.

@xoraingroup
Copy link
Author

Ok good to know. Thank you for the fix.

@TwiN TwiN added bug Something isn't working good first issue Good for newcomers labels Jul 13, 2021
@TwiN TwiN changed the title ICMP not working in Mac OS - IPv4 ICMP does not work on Mac OS Jul 19, 2021
@TwiN TwiN closed this as completed in 43150ae Jul 19, 2021
@TwiN
Copy link
Owner

TwiN commented Jul 19, 2021

@xoraingroup Can you give it a try and let me know if the latest version works?

@xoraingroup
Copy link
Author

Working perfectly fine. Thank you!

@TwiN
Copy link
Owner

TwiN commented Jul 28, 2021

Released in v2.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants