# How to get host CPU configuration?

**URL:** <https://community.dynatrace.com/t/how-to-get-host-cpu-configuration/37336>\
**Category:** Dynatrace API\
**Tags:** dynatrace-api\
**Created:** [November 17, 2022, 10:34am UTC](https://community.dynatrace.com/t/how-to-get-host-cpu-configuration/37336 "2022-11-17T10:34:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Metrologic](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Metrologic](https://community.dynatrace.com/u/Metrologic)\
**Post date:** [November 17, 2022, 10:34am UTC](https://community.dynatrace.com/t/how-to-get-host-cpu-configuration/37336/1 "2022-11-17T10:34:55Z")

</div>

Hello,

We currently use Dynatrace Managed and&nbsp;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.

---

<div class="post-metadata">

**Author:** ![andre\_f](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/andre_f/32/29172_2.png) [@andre\_f](https://community.dynatrace.com/u/andre_f)\
**Post date:** [November 17, 2022, 11:26am UTC](https://community.dynatrace.com/t/how-to-get-host-cpu-configuration/37336/2 "2022-11-17T11:26:56Z")

</div>

Hi&nbsp;[@Metrologic](https://community.dynatrace.com/user/57060)

have you tried this: [V2 API - Get Platform and Get Number of CPUs](https://community.dynatrace.com/post/180812)

---

<div class="post-metadata">

**Author:** ![Metrologic](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Metrologic](https://community.dynatrace.com/u/Metrologic)\
**Post date:** [November 17, 2022, 1:15pm UTC](https://community.dynatrace.com/t/how-to-get-host-cpu-configuration/37336/3 "2022-11-17T13:15:41Z")

</div>

Thank you very much :&nbsp; this seems to be what I need and even more 🙂

I’will try and confirm

---

<div class="post-metadata">

**Author:** ![andre\_f](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/andre_f/32/29172_2.png) [@andre\_f](https://community.dynatrace.com/u/andre_f)\
**Post date:** [November 18, 2022, 7:28am UTC](https://community.dynatrace.com/t/how-to-get-host-cpu-configuration/37336/4 "2022-11-18T07:28:55Z")

</div>

Yes, would be great if you can let me know if this solution helped. Otherwise I would look again 🙂.

---

<div class="post-metadata">

**Author:** ![Metrologic](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Metrologic](https://community.dynatrace.com/u/Metrologic)\
**Post date:** [November 18, 2022, 9:14am UTC](https://community.dynatrace.com/t/how-to-get-host-cpu-configuration/37336/5 "2022-11-18T09:14:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![andre\_f](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/andre_f/32/29172_2.png) [@andre\_f](https://community.dynatrace.com/u/andre_f)\
**Post date:** [November 18, 2022, 9:40am UTC](https://community.dynatrace.com/t/how-to-get-host-cpu-configuration/37336/6 "2022-11-18T09:40:05Z")

</div>

In my case it is ok, I think. This is what Windows shows:

![andre_f_0-1668764069943.png](https://global.discourse-cdn.com/dynatrace/original/2X/7/7247de98b1f8cdc59b572a0947920ce9facb32e9.png)

This is the API result:

```markup
"memoryTotal": 34040684544

```

34040684544 / (1024 \* 1024 \* 1024) = 31,70…
