I would like to monitor my Vaultwarden instance via Uptime Kuma. As I understand the /alive endpoint, it should return a JSON, but actually it’s missing the enclosing curly brackets {} around the DateTime and it has no key. This makes it impossible to use it in the Uptime Kuma JSON query check.
Just tested with https://vault.bitwarden.com/api/alive (which returns the same format) and if I use Monitor Type HTTP(s) it just works. If you want to query the version using a application/json, you could use https://vault.bitwarden.com/api/config.
Of course I can just use the HTTP(s) monitor. But this only checks that the status code is between 200-299. As I understand it, the /api/alive endpoint also checks the database connection and other things.
Do you know if an unhealthy service always returns an appropriate status code?
Nextcloud, for example, does not. It responds with 200, even if the drive where the data is located is unmounted and the service stops working. There I have to explicitly call the serverinfo api with Uptime Kuma and look for "status" = "ok".
Okay, thank you very much. Then it should currently work for me.
I will leave this request open, as I think it is still reasonable to return a valid JSON array at an endpoint that declares to return content as “application/json”.
Oh, okay, didn’t know that a simple string is a valid JSON nowadays. I saw that the expression works on https://try.jsonata.org/, but it doesn’t work in Uptime Kuma. But that’s their problem then, I guess, and I should report it there.