Docker2mqtt: monitor docker containers over mqtt

Tags: #<Tag:0x00007f739eab3970> #<Tag:0x00007f739eab37e0> #<Tag:0x00007f739eab3560>

My quest to turn HA into a dashboard for all my home network monitoring needs continues. :slight_smile: Today I’ve released my program that monitors docker containers on a host and publishes their status to MQTT:

It’s small, lightweight, and exposes all of the events. This means that even brief restarts are captured in HA’s state table.

5 Likes

Thats awesome… does your program support MQTT authentication? The example does not appear to show any

It didn’t, but someone contributed that to ping2mqtt. I copied it over to docker2mqtt and a new release should hit docker hub within 20 or 30 minutes of this message.

2 Likes

Cool… will give it a try straight away! thnx!

Thanks for this, will give it a try.

I have more than one docker host and rather than running a Docker2mqtt instance on each host it would be great if you could connect via LAN to other docker hosts. Don’t you have plans for this capability?

I don’t have plans to add support for connecting to remote docker hosts, but I’d accept a PR for that feature. That said, I would recommend just running a copy of this on each docker host. If you do that when a host goes down all its containers will be marked down in Home Assistant at once thanks to the docker/<host>/status topic changing to offline.

when trying to run this container on a Pi based docker setup i get "exec user process caused “exec format error” after downloading and extracting the images. Could it be this image has not been build for the Pi architecture?

You are correct, I have not had a chance to setup automated builds for other architectures yet. You can clone the git repo and use docker build -t docker2mqtt . to build a container yourself. I will get this setup at some point but it’s not a trivial process. :confused:

I really like the auto discovery of container sensors. I’m using ha-dockermon primally for the ability to restart a container that likes to bug out, but setting up the sensors is a bit of a pain. I’m asking this without any idea what the implications of such a request are, but any plans on giving your container more control over the docker environment? Like enabling the starting and stopping of other containers?

I don’t have plans for that right now, but it’s an interesting use to ponder.