Uptime-Kuma-Web-API icon indicating copy to clipboard operation
Uptime-Kuma-Web-API copied to clipboard

Get Current Status?

Open dsmitty166 opened this issue 2 years ago • 7 comments

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"?

dsmitty166 avatar Feb 07 '23 02:02 dsmitty166

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.

MedAziz11 avatar Feb 11 '23 09:02 MedAziz11

Could you please share how do I get up/down status for specific monitor?

raufis27 avatar Mar 06 '23 22:03 raufis27

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!

hteibler avatar Mar 17 '23 07:03 hteibler

@raufis27 @hteibler /monitors/{monitor_id}/beats => it has a status field, if the status is true then its Up , else its DOWN

MedAziz11 avatar Apr 10 '23 15:04 MedAziz11

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.

PatyYe avatar Apr 21 '23 13:04 PatyYe

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.

nstankov-bg avatar Apr 22 '23 12:04 nstankov-bg

@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

BouncySteak avatar Dec 30 '23 00:12 BouncySteak