Expose health check API
-
The documentation isn’t super clear but it appears there is no way to poll the health check of apps via the API or otherwise programmatically, correct?
I’d like to monitor them with uptime kuma since the error page of apps when they fail to start properly would resolve regularly and therefore not trigger an outage warning with uptime kuma.
-
Hello @andreasdueren
You can use the https://$CLOUDRON_DOMAIN/api/v1/apps/{APPID} - API DOC LINK API route to get thehealthandrunStateof an app.Example with my.demo.cloudron.io:
curl -s "https://my.demo.cloudron.io/api/v1/apps/369f89a2-0e88-4c26-b3e3-8f622b1c5141" -H "Authorization: Bearer 5b28f006a867cba7c7c031553c76058e2054cce65fe27792ead5c85af2f0b6fb" | yq -r .health healthyor
curl -s "https://my.demo.cloudron.io/api/v1/apps/369f89a2-0e88-4c26-b3e3-8f622b1c5141" -H "Authorization: Bearer 5b28f006a867cba7c7c031553c76058e2054cce65fe27792ead5c85af2f0b6fb" | yq -r .runState running
After writing this and reading your post again, are you writing about the
healthCheckPathof theCloudronManifest.json?
So, getting this path via the Cloudron API?
If so, here you go:curl -s "https://my.demo.cloudron.io/api/v1/apps/369f89a2-0e88-4c26-b3e3-8f622b1c5141" -H "Authorization: Bearer 5b28f006a867cba7c7c031553c76058e2054cce65fe27792ead5c85af2f0b6fb" | yq -r .manifest.healthCheckPath / -
Hello @andreasdueren
You can use the https://$CLOUDRON_DOMAIN/api/v1/apps/{APPID} - API DOC LINK API route to get thehealthandrunStateof an app.Example with my.demo.cloudron.io:
curl -s "https://my.demo.cloudron.io/api/v1/apps/369f89a2-0e88-4c26-b3e3-8f622b1c5141" -H "Authorization: Bearer 5b28f006a867cba7c7c031553c76058e2054cce65fe27792ead5c85af2f0b6fb" | yq -r .health healthyor
curl -s "https://my.demo.cloudron.io/api/v1/apps/369f89a2-0e88-4c26-b3e3-8f622b1c5141" -H "Authorization: Bearer 5b28f006a867cba7c7c031553c76058e2054cce65fe27792ead5c85af2f0b6fb" | yq -r .runState running
After writing this and reading your post again, are you writing about the
healthCheckPathof theCloudronManifest.json?
So, getting this path via the Cloudron API?
If so, here you go:curl -s "https://my.demo.cloudron.io/api/v1/apps/369f89a2-0e88-4c26-b3e3-8f622b1c5141" -H "Authorization: Bearer 5b28f006a867cba7c7c031553c76058e2054cce65fe27792ead5c85af2f0b6fb" | yq -r .manifest.healthCheckPath /@james Perfect, thank you!