ualex73 / monitor_docker

Monitor Docker containers from Home Assistant
Apache License 2.0
268 stars 34 forks source link

Feature: add a way to monitor container health status #33

Closed bash-worth closed 3 years ago

bash-worth commented 3 years ago

Thanks for creating this, it's working really well.

It would be great to also be able to monitor container health status in addition to state / status as a lot of the time containers keep on running when problems occur.

Thanks again.

ualex73 commented 3 years ago

Health-check should be done directly via Docker (it is also way to complex to build it in this script), but i could check if i can expose such value.

bash-worth commented 3 years ago

Maybe as part of the status sensor? That's how ha-dockermon exposes it.

E.g. "up 11 days (healthy)"

Thanks!

guice commented 3 years ago

Came here for this. While I agree health data is directly via Docker, I'd like to build triggers around container health. It's quite common for my VPN container to go "Unhealthy".

bash-worth commented 3 years ago

That's exactly why I needed that functionality. In the meantime you can get container health status with ha_dockermon:

https://github.com/philhawthorne/ha-dockermon

Just set up a rest sensor to get the health status.

rsegers commented 3 years ago

Requested merge from PR #51 to add support for the Health status of containers as a separate sensor/attribute. Adding it to the 'status' might break something for someone.

May be for a next version, it should be shown as the state of the container in stead of running.

ualex73 commented 3 years ago

Yes, separate sensor/attribute is the best way forward (as @rsegers says, it will break something else otherwise).

ualex73 commented 3 years ago

The #51 is merged, so I will close this ticket.