App Error / Status Page
-
@nichu42 said in App Error / Status Page:
That's a much more elegant way to track the status with Uptime Kuma than my current approach!
I'm currently just using the standard default HTTP(s) monitor, e.g.
I'm wondering how using the API would be better. Better how?
-
@jdaviescoates I found using the api was much more reliable (json app responses), especially if you're using Cloudflare. I found that if the app was down but Cloudflare (Always On) would show a http response so the app wouldn't be showing the true status.
-
@nebulon said in App Error / Status Page:
Not sure if uptime kuma can be scripted that way to extract
health
andrunState
from the json result.It appears to me that neither JSON key matching nor Regex are implemented yet, but there are open issues for both.
I was just taking the advice from @JLX89 because I felt that checking for runState might not be enough. But could you please explain the check behind health=healthy?
-
@nichu42 said in App Error / Status Page:
@nebulon said in App Error / Status Page:
Not sure if uptime kuma can be scripted that way to extract
health
andrunState
from the json result.It appears to me that neither JSON key matching nor Regex are implemented yet, but there are open issues for both.
I was just taking the advice from @JLX89 because I felt that checking for runState might not be enough. But could you please explain the check behind health=healthy?
I've had it setup using the following and it seems to have been working, if the app goes offline it is reflected in Uptime Kuma.
- Monitor Type: HTTPS(s) - Keyword
- URL: Cloudron API URL
- Keyword: healthy
- HTTP Options - Method: "GET"
I'm assuming you could probably pull either of the following based on the Cloudron API documentation: "runState": "running" or "health": "healthy"?
This at least seems to be working for me -- but could be a better way of doing this. The obvious downfall is if you're tracking uptime rather than just status if you make config changes or need to restart the app this is reflected -- so we bumped up the heartbeat retry levels.
-
@nichu42
If you want to hack around.️ Notice: totally unofficial!
The files are here
/home/yellowtent/box/dashboard/dist/
appstatus.html notfound.html
You could hack a custom
HTML
in there, replacing the files (make a backup of the original files), which just redirects to, lets say, an uptime kuma or something else.Have fun
-
Ooops, I think it's the second time I have started a thread that could have been answered with a short RTFM. I'm glad that @girish is way too polite.
Thanks, I have set up the custom pages. Works perfectly. Now I can redirect visitors to my (externally hosted) uptime kuma status page when an app is not ressponding. -
@robi
Is there any specific you'd like to know?
I just did as mentioned in the doc:- Created a new directory /home/yellowtent/boxdata/custom_pages
- Created two html files app_not_responding.html and notfound.html with nano and pasted in the HTML code that I had prepared on my computer
- Saved and voilà
The HTML files contained an explanation of what went wrong and a link to my already existing uptime kuma status page, where I put a note to users if there is a longer downtime (planned or unplanned). I have uptime kuma running on a separate VPS so it does not depend on Cloudron to be working. I am checking for health via API as suggested earlier in this thread. You can see the result here: https://status.42bit.io
-
@nichu42 Yes, that's excellent, and the 2 html files are interesting for folks to see as inspirations of what to write and how to redirect to an external site.
Especially if they're nice and fancy with CSS!
Example or template code is always nice to have.
-
@robi I'm sorry to disappoint you, but the HTML files I created are very simple. The fancy stuff happens on the uptime kuma page. If you are still interested, here's the code:
<!DOCTYPE html> <html> <head> <title>HTTP 503 - Service unavailable</title> </head> <body> <center> <h1>HTTP 503 - Service unavailable</h1> <p><b>Ooops, sorry. The service you requested is not loading at the moment.<br> Hopefully it's just a restart as part of regular maintenance, so</b></p> <h2>please try again in a few minutes.</h2> <p><b>If you keep getting this error message, please visit our <a href="https://status.42bit.io">status page</a>, which usually has more details about longer outages.</b></p> <p>If you think the 42bit.io / blueplanet.social admin should have a look at this, please reach out to <a href="mailto:admin@42bit.io">admin@42bit.io</p></a> </center> </body> </html>
<!DOCTYPE html> <html> <head> <title>HTTP 404 - Not found</title> <meta http-equiv="refresh" content="15; url='https://42bit.io'" /> </head> <body> <center> <h1>HTTP 404 - Not found</h1> <p><b>Sorry, I cannot find what you were looking for.</b></p> <p><b>All I can do is redirect you to my <a href="https://42bit.io">home page</a>, which I will try in a few seconds.</b></p> <p>If you think the 42bit.io / blueplanet.social admin should have a look at this error, please reach out to <a href="mailto:admin@42bit.io">admin@42bit.io</p></a> </center> </body> </html>