Uptime-Kuma-Web-API
Uptime-Kuma-Web-API copied to clipboard
Get Current Status?
I could very well be just over looking this, but where can I pull current monitor status from? ie is a monitor "up or down"?
there is no end point that returns this specific info but u can know that from /ping or /uptime , in the mean time ill try to add it, thnx for the contribution.
Could you please share how do I get up/down status for specific monitor?
actually this was my main point to look at this !
great work so far,
but my use-case would be to get the overall status in my nodered dashboard an use it in flows!
@raufis27 @hteibler /monitors/{monitor_id}/beats => it has a status field, if the status is true then its Up , else its DOWN
Would be nice if we use the /monitors it'll include beats in a serpeate json object for each monitor. Will gain a lot of stress on the query, but much better then querying each monitor individually.
This would make the object too big on large-scale deployments. the global /monitors gives you the generic information and IDs.
From there you query every monitor individually for granular control.
In my example I have over 600 monitors. The JSON produced will be absolutely ineffective to process.
@raufis27 @hteibler /monitors/{monitor_id}/beats => it has a status field, if the status is true then its Up , else its DOWN
I notice that the response is in relation to Uptime-Kuma itself and not the status of the actual monitor. And in my case returns 200, not "true"
Currently I am processing the last beat in /monitors/{monitor_id}/beats
How to get last beat in JS
As if jsonResponse is the raw json from the API
jsonResponse[Object.keys(jsonResponse)[Object.keys(jsonResponse).length - 1]].status