17 Nov 2022 10:34 AM - last edited on 20 Aug 2024 03:11 PM by Michal_Gebacki
Hello,
We currently use Dynatrace Managed and I would like to get with API v2 the number of CPU or cores configured for each of our hosts (Virtual or Physical standalone servers running windows or Linux).
I can't find any MetricId in the API V2 list that suit my need.
I could find the right MetricId for host configured memory (builtin:containers.memory.physicalTotalBytes) but not for host number of Virtual CPU(Or Cores) configured : does anyone found the right metricID ?
Thanks for your help.
Solved! Go to Solution.
17 Nov 2022 01:15 PM
Thank you very much : this seems to be what I need and even more 🙂
I'will try and confirm
18 Nov 2022 07:28 AM
Yes, would be great if you can let me know if this solution helped. Otherwise I would look again 🙂.
18 Nov 2022 09:14 AM
Hello Andre,
Yes that's running perfect ! I could get the number of cores and many other usefull informations.
By the way, one extra question ! in the json answer fle, physical memory size is not exactly an Mb or Gb multiple.
Example :
Our server has 32Gb RAM, but in the json file we have find :
"memoryTotal": 33512501248,
"physicalMemory": 33512501248
And so 33512501248 / (1024 * 1024 *1024) = 31,2109 ....
I Stay confused
18 Nov 2022 09:40 AM
In my case it is ok, I think. This is what Windows shows:
This is the API result:
"memoryTotal": 34040684544
34040684544 / (1024 * 1024 * 1024) = 31,70....