13 Jun 2018 12:08 PM - last edited on 25 May 2021 03:38 PM by MaciejNeumann
We need to get the host license consume, Can we get it using Dynatrace API?
Solved! Go to Solution.
13 Jun 2018 08:05 PM
Hi Fransisco,
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.
Thanks
NJ
14 Jun 2018 07:22 AM
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.
Thank you.
14 Jun 2018 06:00 PM
No problem. You can create an RFE for this to be directly accessible via an API call.
Thanks
NJ
19 Jun 2018 12:06 PM
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?
19 Jun 2018 04:13 PM
Hi Luis,
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.
Thanks
NJ
20 Jun 2018 09:17 AM
Hi,
JSON does contain version information:
"agentVersion":{"major":1,"minor":143,"revision":161,"sourceRevision":"","timestamp":"20180524-165023"}
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?