ualex73 / monitor_docker

Monitor Docker containers from Home Assistant
Apache License 2.0
298 stars 37 forks source link

Can not connect to Docker API - but Container Log shows regular connections #154

Open mptr8956 opened 4 months ago

mptr8956 commented 4 months ago

Hi tried to set this one up, but still failing. My setup: HAOS in a proxmox VM and docker in another LXC container. Added the container via docker-compose and bound the docker.sock to it. Trying to connect via console of the LXC & docker -H tcp://10.0.0.1:2376 ps works like a charm.

This is my config in HA: image

If I add the config to Home-Assistant, i see regular calls in the logs of the dockerproxy container: image

But HA drops the following errors in the Log and the entities do not show up:

image

What am I doing wrong?

MadmanMonty commented 2 months ago

I came across your issue while trying to solve a problem I am having, and while I cannot solve my issue, I do think I see your issue....

You have an extra dash in your config, which is causing 2 instances to be attempted, first with a URL, but is missing a mandatory name, and second with a name, but missing your intended url: If you remove the dash before name I think that will solve your issue.

monitor_docker:
  - url: tcp://192.168.1.35:2375
    name: Docker
    buttonenabled: true
    monitored_conditions:
        - version
        - containers_running
        - containers_total
        - state
        - uptime