TwiN / gatus

⛑ Automated developer-oriented status page

Home Page:https://gatus.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ping not working in neither docker nor k3s

heathcliff26 opened this issue · comments

Describe the bug

When running gatus from inside k3s or in plain docker, all attempts to monitor nodes via ping fail, despite the being reachable. I have verified that the nodes can be pinged from the gatus host.

What do you see?

When adding endpoint with ping, status check always fails, regardless of node status.

What do you expect to see?

Ping should succeed if the endpoint is reachable.

List the steps that must be taken to reproduce this issue

  1. Create config.yaml with the following content:
endpoints:
  - name: router
    group: test
    url: "icmp://example.com"
    interval: 1m
    conditions:
      - "[CONNECTED] == true"
  - name: router-ipv4
    group: test
    url: "icmp://192.168.0.1"
    interval: 1m
    conditions:
      - "[CONNECTED] == true"
  1. Start gatus with:
podman run -p 8080:8080 -v ./config.yaml:/config/config.yaml --name gatus -d  docker.io/twinproduction/gatus:v5.10.0

Version

v5.10.0

Additional information

Here is the output from the log:

2024/04/28 16:19:56 [config.LoadConfiguration] Reading configuration from configFile=
2024/04/28 16:19:56 [config.validateAlertingConfig] Alerting is not configured
2024/04/28 16:19:56 [config.validateEndpointsConfig] Validated 2 endpoints
2024/04/28 16:19:56 [config.validateExternalEndpointsConfig] Validated 0 external endpoints
2024/04/28 16:19:56 [store.Initialize] Creating storage provider of type=memory
2024/04/28 16:19:56 [controller.Handle] Listening on 0.0.0.0:8080

 ┌───────────────────────────────────────────────────┐ 
 │                   Fiber v2.52.1                   │ 
 │                 http://[::]:8080                  │ 
 │                                                   │ 
 │ Handlers ............ 27  Processes ........... 1 │ 
 │ Prefork ....... Disabled  PID ................. 1 │ 
 └───────────────────────────────────────────────────┘ 

2024/04/28 16:20:02 [watchdog.execute] Monitored group=test; endpoint=router; success=false; errors=0; duration=0s
2024/04/28 16:20:02 [watchdog.execute] Monitored group=test; endpoint=router-ipv4; success=false; errors=0; duration=0s
2024/04/28 16:21:02 [watchdog.execute] Monitored group=test; endpoint=router-ipv4; success=false; errors=0; duration=0s
2024/04/28 16:21:07 [watchdog.execute] Monitored group=test; endpoint=router; success=false; errors=0; duration=0s
2024/04/28 16:22:02 [watchdog.execute] Monitored group=test; endpoint=router-ipv4; success=false; errors=0; duration=0s
2024/04/28 16:22:12 [watchdog.execute] Monitored group=test; endpoint=router; success=false; errors=0; duration=0s
2024/04/28 16:23:02 [watchdog.execute] Monitored group=test; endpoint=router-ipv4; success=false; errors=0; duration=0s
2024/04/28 16:23:17 [watchdog.execute] Monitored group=test; endpoint=router; success=false; errors=0; duration=0s
2024/04/28 16:24:02 [watchdog.execute] Monitored group=test; endpoint=router-ipv4; success=false; errors=0; duration=0s
2024/04/28 16:24:22 [watchdog.execute] Monitored group=test; endpoint=router; success=false; errors=0; duration=0s
commented

Can you try setting endpoints[].client.network to ip4?

endpoints:
  - name: router
    #...
    client:
      network: ip4

I did, this does not seem to change anything.

I don't know if you meant ip4 as written or ipv4, but i tried both:

endpoints:
  - name: router
    group: test
    url: "icmp://example.com"
    client:
      network: ipv4
    interval: 1m
    conditions:
      - "[CONNECTED] == true"
commented

I meant ip4, but no worries.

In that case, I reckon the problem has to have something to do with privilege magic.
I'm going to close this as a duplicate of #697