Open MarkusGnigler opened 3 weeks ago
Maybe try 10.0.0.15:45876
, or just 45876
.
If that doesn't work, please paste your docker compose here.
Thanks for the fast reply.
I have started with the PORT
variable set only to 45876 as from the example docker compose file.
Kind of fixed it for now by removing the network_mode: host
and using regular port mapping.
This is my docker compose file:
services:
beszel-agent:
image: "henrygd/beszel-agent"
container_name: "beszel-agent"
restart: unless-stopped
ports:
- 45876:45876
# network_mode: host
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
# monitor other disks / partitions by mounting a folder in /extra-filesystems
# - /mnt/disk1/.beszel:/extra-filesystems/disk1:ro
environment:
PORT: 0.0.0.0:45876
KEY: "XXX"
# FILESYSTEM: /dev/sda1 # override the root partition /
Any guess whats the problem here? Network monitoring would be nice.
I'm not really sure. This is the first time this behavior has been mentioned. My guess is that it has to do with network configuration on the host machine.
The address:port is passed directly to the gliderlabs/ssh ListenAndServe
method, as you found earlier.
That calls net.Listen("tcp", addr)
from the standard library. Docs for net.Listen
say the following:
For TCP networks, if the host in the address parameter is empty or a literal unspecified IP address, Listen listens on all available unicast and anycast IP addresses of the local system.
You can try the binary to see if you get the same problem. That would at least rule out a Docker issue.
I had something similar:
sudo netstat -tulnp | grep 45876 tcp6 0 0 :::45876 :::* LISTEN 49773/agent
But I actually now turned off "host" type... Maybe for me this is different anyways... I use it like this:
beszel:
image: 'henrygd/beszel'
container_name: 'beszel'
restart: unless-stopped
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./beszel:/beszel_data
networks:
- web
- internal
labels:
- 'traefik.enable=true'
- 'traefik.docker.network=web'
- "traefik.http.services.beszel.loadbalancer.server.port=8090"
- 'traefik.http.routers.beszel.rule=Host(`beszel.domain.my`)'
- 'traefik.http.routers.beszel.entrypoints=websecure'
- 'traefik.http.routers.beszel.tls.certresolver=letsencrypt'
beszel-agent:
image: "henrygd/beszel-agent"
container_name: "beszel-agent"
restart: unless-stopped
networks:
- internal
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
PORT: 45876
KEY: "ssh-ed25519 xyz"
labels:
- 'traefik.enable=false'
In beszel itself, I added the agent like this: "beszel-agent" since they are both in the "internal" docker network, the connection between them works.. Before, even with "host" ist was not working.
I'm looking forward when the beszel hub is an agent as well <3
btw... Is there a PayPal where one can show some appreciation?
I'll look into this further. Not sure why it wouldn't listen on both tcp4 and tcp6. Maybe something with Docker networking.
For running on the same system, try adding an extra_hosts
property to the hub and using host.docker.internal
as the agent's hostname. That should work with host network mode and allow you to pull in bandwidth stats.
It's explained more in these issues / discussions: #73, #78, #193
I would love to have an agent built into the hub, but it would require you to run the hub in host network mode to get host network metrics. That's a deal breaker for me because it would be much more difficult to connect the hub to other Docker services like reverse proxies.
There's a workaround that requires running an additional tiny helper container that I'll experiment with at some point. You can read more about this here: #140
@christianromeni I do have Buy Me a Coffee page that I plan to link in the docs website when I get that running. I appreciate any support, but it's obviously not required or expected!
i have a docker deployment of the agent in a regular ipv4 network and the ssh server starts only on ipv6. i does not have anything configure for ipv6 and i have set the the
PORT
variable to0.0.0.0:45876
This obviously means i cant reach my agent.
Is it somewhat related to the start process?
https://github.com/henrygd/beszel/blob/ec7cb53d935b7d07ed1fbf8fd0893856e75c3981/beszel/internal/agent/server.go#L15