Downtime states of hosts via API

Hi everybody,

I am currently looking for a possibility to determine the downstate of “CRITICAL” hosts via API requests.

Let’s say I have a request which returns a list of all hosts which host-alive-checks fail, is there a possibility to determine if they are scheduled for a downtime right now, e.g. by firing another request or querying an additional attribute?

I couldn’t find anything on this topic up to now…

Best regards
Daniel

If you query the host or service object, under attrs in the json you’ll see a value called downtime_depth. This is how many downtimes are applied to that object, so anything > 0 is what you would catch.

Actually, that’s just active/triggered downtimes. In order to fetch all downtimes scheduled for this specific host, you need to reverse the strategy with querying /v1/objects/downtimes with the host name as filter.

Cheers,
Michael