Cloudron Health Check Endpoint
-
Hello All,
Is it possible to have Uptime Kuma hit a specific endpoint for monitoring apps inside Cloudron? We'd like to use the health check service, if possible rather than hitting the DNS or IP, since we're using the same IP from most apps and using Cloudflare for DNS which both don't give accurate results.Is it possible to hit an endpoint such as https://app-name.domain.tld/cloudron_healthcheck or similar end point with Uptime Kuma?
Thank you!
-
Hi @JLX89,
the health status of a given app can be retrieved from the Cloudron api. See https://docs.cloudron.io/api.html#tag/Apps/paths/~1apps~1{appid}/get for the relevant request.
You would need to add an auth header to your request. From what I can see Uptime Kuma does not have the possibility to perform operations on the json response of the api, but you could do a keyword match instead.
-
-
-
Since I am always missing notifications in Cloudron (don't log into the dashboard often enough) I decided to add a monitor for it to Uptime Kuma.
- Add New Monitor
- Monitor Type: HTTP(s) - Keyword
- URL: https://my.domain.com/api/v1/notifications?acknowledged=false&page=1&per_page=2
- Keyword:
"notifications":[]
- Heartbeat Interval:
360
(could be higher however, I don't need instant alerts for new notifications)
Since the api only works with auth, we also need to send a header for this. For this paste the following in the "Headers" field:
{ "authorization": "Bearer xxx" }
The
xxx
needs to be replaced with a valid api token, which can be created in the user profile.Everything you can see on the Cloudron dashboard comes from the Cloudron api. So if further checks are needed I always recommend to pop out the network console and check which endpoints get requested for the data you need.
-
@robi So I did this slightly different than @fbartels did, which also seems to be working.
- Add New Monitor
- Monitor Type: HTTP(s) - Keyword
- URL: https://my.cloudron.tld/api/v1/apps/{APP_ID}/?access_token={API_KEY}
- Keyword: healthy
- HTTP Options
- Method: GET
- Body:
{ "runState": "running", "health": "healthy" }
I retrieved the AppID from going go https://my.cloudron.tld/api/v1/apps/?access_token={API_KEY}
So far this seems to be working over the past few days.
-
Ah yes, I forgot that you can also add the api token as a url parameter
@JLX89 said in Cloudron Health Check Endpoint:
Body
Since this refers to the request body you could empty this field, as the value you have in there is simply the response that the Cloudron api would deliver.
-
@fbartels said in Cloudron Health Check Endpoint:
Ah yes, I forgot that you can also add the api token as a url parameter
@JLX89 said in Cloudron Health Check Endpoint:
Body
Since this refers to the request body you could empty this field, as the value you have in there is simply the response that the Cloudron api would deliver.
Thanks, yes -- I actually cleared that out a bit ago to see if it works. The only downfall using the method I used, is occasionally you'll get a "200 - OK, but keyword is not found", even though the app is online and functioning.