homeassistant-portainer icon indicating copy to clipboard operation
homeassistant-portainer copied to clipboard

[Feature] Implement health-checks as status

Open luc-ass opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

I have implemented health-checks for most of my containers, which is really helpful when trying to solve problems before they affect production. This feature is not available via the integration, thus making it impossible to reflect the actual status in home assistant (running ≠ healthy).

Describe the solution you'd like

Implement (if possible) health status, so that the dashboard for example could show all containers that are unhealthy.

Describe alternatives you've considered

Additional context

luc-ass avatar Nov 15 '23 09:11 luc-ass

As portioner seems to act like a reverse-proxy against the docker, this could also work:

From what I was able to find in the documentation for /containers/json this does not actually include the health status:

"State": "Exited",
"Status": "Exit 0",

Digging deeper, the documentation for containers/{id}/json does actually contain information about container health:

"State": {
    "Error": "",
    "ExitCode": 9,
    "FinishedAt": "2015-01-06T15:47:32.080254511Z",
    "Health": {
        "Status": "healthy",
        "FailingStreak": 0,
        "Log": []
    },

So this would be a possible solution... alternatively /events seems to contain this kind of information... but I don't know how practical this kind of stream would be.

luc-ass avatar Nov 15 '23 13:11 luc-ass

This will be great, to become build block for a future switch support, because running works, but with healthy status when supported will be really nice.

webysther avatar Jan 23 '24 16:01 webysther