devforth / hothost

Lightweight and minimalistic open-source Servers and HTTP monitor
MIT License
169 stars 14 forks source link

Agent can't connect to server #10

Closed zakabluk closed 2 years ago

zakabluk commented 2 years ago

I Use for several servers and one agent can't connect to server hothost.

docker logs --tail 20 -f hothost-agent
curl: (28) Failed to connect to IP port 8007 after 131055 ms: Connection timed out
curl: (28) Failed to connect to IP port 8007 after 130282 ms: Connection timed out
curl: (28) Failed to connect to IP port 8007 after 131060 ms: Connection timed out
nc -vz IP 8007
Connection to IP 8007 port [tcp/*] succeeded!
--- IP ping statistics ---
106 packets transmitted, 106 received, 0% packet loss, time 105157ms

Hothost server located in Germany, agent located in Turkey. Maybe it's possible to increase timed out for connection between agent server ?

ivictbor commented 2 years ago

I don't think timeout is an issue, how agest command looks for you? Please post docker/compose/bash snippet but without a secret, I would like to check URL

zakabluk commented 2 years ago
docker run -d \
  --env HOTHOST_SERVER_BASE=http://MY_IP:8007 \
  --env HOTHOST_AGENT_SECRET=SECRET \
  --env HOTHOST_MONITOR_INTERVAL=60 \
  --name hothost-agent \
  -v /proc:/host/proc:ro \
  -v /sys:/host/sys:ro \
  -v /etc/os-release:/host/etc/os-release:ro \
  -v /etc/hostname:/host/etc/hostname:ro \
  --restart unless-stopped \
  --cap-add SYS_PTRACE \
  --security-opt apparmor=unconfined \
  devforth/hothost-agent
ivictbor commented 2 years ago

Hm, LGTM,

I would login into container

docker exec -ti hothost-agent sh

There

apt-get update && apt-get install netcat nc -vz MY_IP 8007

If that still works then let's try

bash -x getinfo.sh

Find curl command there, how would it look?

zakabluk commented 2 years ago

It was problem with docker. Internet connection and dns resolve didn't work into container.