Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Cloudron Forum

Apps | Demo | Docs | Install

Cloudron Health Check Endpoint

Scheduled Pinned Locked Moved Solved Uptime Kuma
9 Posts 3 Posters 501 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JLX89
    wrote on last edited by
    #1

    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!

    fbartelsF 1 Reply Last reply
    1
  • fbartelsF Offline
    fbartelsF Offline
    fbartels App Dev
    replied to JLX89 on last edited by
    #2

    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.

    J 1 Reply Last reply
    3
  • J Offline
    J Offline
    JLX89
    replied to fbartels on last edited by
    #3

    @fbartels Thank you so much -- that worked out perfectly!

    robiR 1 Reply Last reply
    4
  • robiR Offline
    robiR Offline
    robi
    replied to JLX89 on last edited by
    #4

    @JLX89 Can you jot down what you did to make it work for others in the future as well?

    Life of sky tech

    J 1 Reply Last reply
    4
  • nebulonN nebulon marked this topic as a question on
  • nebulonN nebulon has marked this topic as solved on
  • fbartelsF Offline
    fbartelsF Offline
    fbartels App Dev
    wrote on last edited by
    #5

    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.

    1 Reply Last reply
    7
  • J Offline
    J Offline
    JLX89
    replied to robi on last edited by
    #6

    @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.

    fbartelsF 1 Reply Last reply
    4
  • fbartelsF Offline
    fbartelsF Offline
    fbartels App Dev
    replied to JLX89 on last edited by
    #7

    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.

    J 1 Reply Last reply
    0
  • J Offline
    J Offline
    JLX89
    replied to fbartels on last edited by
    #8

    @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.

    fbartelsF 1 Reply Last reply
    1
  • fbartelsF Offline
    fbartelsF Offline
    fbartels App Dev
    replied to JLX89 on last edited by
    #9

    @JLX89 maybe you want to add a retry to this. So that it's only marked as down at the e.g. second failed check.

    1 Reply Last reply
    2

  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks