cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to retrieve Host Availability metrics via REST API

AmitChiba
Contributor

Hi,

In our environment, we have a requirement to extract the Host last reboot time from AppMon, as well as Dynatrace (Managed). I have been able to do so via a REST API call for AppMon, but Dynatrace Managed appears to be more challenging.

In Managed, I see in the GUI that the Uptime is recorded when looking at the Host details, but this is very vague (e.g. Uptime: over 183 days). My next thought was to consider pulling the availability metrics for a process (*NIX: systemd process, Windows: System process) as this does provide a specific time in the GUI as to when the last downtime occurred (e.g. 5 h 18 min
total downtime Last downtime on 21-02-2018 07:24 - 07:25).

Is there a way that one can retrieve this via a REST API call? Has anyone done this before?

7 REPLIES 7

wolfgang_beer
Dynatrace Champion
Dynatrace Champion

You can pull the host availability metric from the Dynatrace REST API:

com.dynatrace.builtin:host.availability

https://www.dynatrace.com/support/help/dynatrace-api/timeseries/how-do-i-fetch-the-metrics-of-monitored-entities/#available-timeseries

Here is a good example of a HTML process and host availability report fetched by API that calculates the same numbers as our Web UI shows:

https://github.com/Dynatrace/dynatrace-api/tree/ma...

Best,

Wolfgang

Thanks Wolfgang, I will try this.

jeppe_lindberg3
Newcomer

@Wolfgang B. will process and host availability be added to the api v2 soon?


Yes we will add it pretty soon.


is it added in api v2?

not so far but we will not forget about that

Any updates on this?