13 Jun 2018 04:08 AM - last edited on 25 May 2021 07:38 AM by MaciejNeumann
We need to get the host license consume, Can we get it using Dynatrace API?
Solved! Go to Solution.
Not directly but this is possible. The API call to fetch the list of monitored hosts also contains the consumed host units for each host in the response. You can write a script (using Python for example to parse this info and calculate the consumed host units) it also contains the info of the hosts monitoring mode (i.e Full Stack or Cloud infra). It is not as simple but it can be done.
Hi that's is what we saw in the API, but we want to know if it's directly accessible.
We should extract the information then.
No problem. You can create an RFE for this to be directly accessible via an API call.
The API is exporting data of servers that do have monitoring disabled but returned JSON does not show whether monitoring is enabled or disabled. Is that a bug in API behavior? if not, how can we filter on actively monitored hosts?
For the hosts with monitoring disabled, do you see the agentVersion property for them? That could be a way to filter them with a script (e.g. python) if there is no value for that property for these disabled hosts. Another possible option is to use the startTimestamp and endTimestamp filters in the API call for a more recent time to ensure only recently seen hosts in that time-range are reported. These timestamps must be in UTC milliseconds with a max of 3 days.
JSON does contain version information:
I guess you refer to firstSeenTimestamp and lastSeenTimestamp, am I correct? if so, would a turned down/unresponsive server get lastSeenTimestamp updated? we could be taking out servers from the report that are temporarily down or unresponsive. Shouldn't disabled monitored servers be taken out of the API query?