# Retrieve host total memory via API

**URL:** <https://community.dynatrace.com/t/retrieve-host-total-memory-via-api/19905>\
**Category:** Dynatrace API\
**Tags:** hosts-classic, dynatrace-api\
**Created:** [March 7, 2019, 7:15am UTC](https://community.dynatrace.com/t/retrieve-host-total-memory-via-api/19905 "2019-03-07T07:15:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![avdveen](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@avdveen](https://community.dynatrace.com/u/avdveen)\
**Post date:** [March 7, 2019, 7:15am UTC](https://community.dynatrace.com/t/retrieve-host-total-memory-via-api/19905/1 "2019-03-07T07:15:35Z")

</div>

The API only allows one to retrieve memory available (com.dynatrace.builtin:host.mem.available) and memory used (com.dynatrace.builtin:host.mem.used), I don’t see an option for total memory. Am I right in saying that to get total memory, I could simply [add available and used](https://answers.dynatrace.com/answers/217870/view.html)? What about the newly introduced [reclaimable memory](https://www.dynatrace.com/news/blog/improved-host-memory-metrics-now-include-reclaimable-memory/), will that make it into the timeseries metrics and how would that affect my calculation, if at all?

I’m pulling the json data for available and used memory into Power BI, but the total never adds up correctly - I checked the values prior to pulling them into BI and even then they don’t add up correctly…has anyone else seen this? Either I’m doing something wrong, or misunderstanding the values. I’ve checked the values (Bytes) and irrespective of whether I divide the Bytes value by 1024 (binary) or 1000 (decimal) to get to KB, it ends up with the incorrect values. I’ve tried using MAX, MIN, AVG over very short and longer timeframes, using TOTAL instead of SERIES, but I never get the values I see on the host details dashboard.

---

<div class="post-metadata">

**Author:** ![jerry\_gassie](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@jerry\_gassie](https://community.dynatrace.com/u/jerry_gassie)\
**Post date:** [March 25, 2019, 6:59pm UTC](https://community.dynatrace.com/t/retrieve-host-total-memory-via-api/19905/2 "2019-03-25T18:59:31Z")

</div>

I would also be interested in this… there should be a “total” timeseriesId type…

Or, they should just add the “total memory” value as a property returned for the standard Hosts calls

---

<div class="post-metadata">

**Author:** ![jeff\_rowell](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jeff\_rowell](https://community.dynatrace.com/u/jeff_rowell)\
**Post date:** [August 12, 2019, 4:56pm UTC](https://community.dynatrace.com/t/retrieve-host-total-memory-via-api/19905/3 "2019-08-12T16:56:06Z")

</div>

I have a similar question / issue. I want to retrieve the total memory for each monitored server, and I am unable to make sense of the values that are returned via com.dynatrace.builtin:host.mem.used. The value returned by the API does not match the total, reclaimable, or used values shown in Dynatrace, or any combination of these. Is there any way to programatically obtain the total server memory?

---

<div class="post-metadata">

**Author:** ![handjojo\_sebast](https://avatars.discourse-cdn.com/v4/letter/h/91b2a8/32.png) [@handjojo\_sebast](https://community.dynatrace.com/u/handjojo_sebast)\
**Post date:** [August 17, 2020, 6:05am UTC](https://community.dynatrace.com/t/retrieve-host-total-memory-via-api/19905/4 "2020-08-17T06:05:59Z")

</div>

1 year later no one from Dynatrace answer this question. This is such  
basic functionality, that the API cannot provide. And we are paying  
millions for this software

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [August 17, 2020, 9:45am UTC](https://community.dynatrace.com/t/retrieve-host-total-memory-via-api/19905/5 "2020-08-17T09:45:09Z")

</div>

There is an RFE for this:

> **[Login | Dynatrace](https://sso.dynatrace.com/action/signin?goto=https%3A%2F%2Fsso.dynatrace.com%3A443%2Foauth2%2Fauthorize%2Fredirect%3FoAuth2CtxUuid%3D0bff0529-7106-45ef-b624-2764a09c64b3&oAuth2RedirectUri=https%3A%2F%2Fcommunity.dynatrace.com%2Fauth%2Foauth2callback)**

---

<div class="post-metadata">

**Author:** ![handjojo\_sebast](https://avatars.discourse-cdn.com/v4/letter/h/91b2a8/32.png) [@handjojo\_sebast](https://community.dynatrace.com/u/handjojo_sebast)\
**Post date:** [August 17, 2020, 10:40am UTC](https://community.dynatrace.com/t/retrieve-host-total-memory-via-api/19905/6 "2020-08-17T10:40:19Z")

</div>

so if we bought a 32 GB of RAM for server,  
and the online Shop even bill me for 32GB of RAM,  
and we install it to the hardware and Bios detect 32 GB of RAM,  
and Windows said also 32 GB of RAM,  
and Dynatrace (we paid millions) said look here calculate yourself …

is that it ?

---

<div class="post-metadata">

**Author:** ![ThomasEaton](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/thomaseaton/32/38694_2.png) [@ThomasEaton](https://community.dynatrace.com/u/ThomasEaton)\
**Post date:** [March 16, 2021, 10:43pm UTC](https://community.dynatrace.com/t/retrieve-host-total-memory-via-api/19905/7 "2021-03-16T22:43:59Z")

</div>

Yep 😛 haha

---

<div class="post-metadata">

**Author:** ![MaciejNeumann](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@MaciejNeumann](https://community.dynatrace.com/u/MaciejNeumann)\
**Post date:** [April 26, 2022, 11:57am UTC](https://community.dynatrace.com/t/retrieve-host-total-memory-via-api/19905/8 "2022-04-26T11:57:39Z")

</div>

Sharing this information from [@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp;from the related Product Idea:

This is possible now through&nbsp;[Monitored entities v2 API.](https://www.dynatrace.com/support/help/shortlink/api-entities-v2?_ga=2.188506667.2061216437.1650870575-939210357.1648450979)

The memory information is available in host properties, see below:

```markup
{
  "entityId": "HOST-21D46EE82F6733A8",
  "displayName": "xxx.yyy",
  "firstSeenTms": 1600762172193,
  "lastSeenTms": 1631130266472,
  "properties": {
    "bitness": "64",
    "detectedName": "xxx.yyy",
    "installerTrackedDownload": false,
    "oneAgentCustomHostName": "",
    "monitoringMode": "FULL_STACK",
    "installerVersion": "1.223.105.20210824-140926",
    "ipAddress": [
      "1.2.3.4"
    ],
    "osArchitecture": "X86",
    "hypervisorType": "VMWARE",
    "networkZone": "default",
    "standaloneSpecialAgentsOnly": false,
    "isMonitoringCandidate": false,
    "logicalCpuCores": 4,
    "osVersion": "Red Hat Enterprise Linux Server 7.8 (Maipo) (kernel 3.10.0-1127.el7.x86_64)",
    "cpuCores": 4,
    "installerPotentialProblem": false,
    "memoryTotal": 16656887808,
    "osType": "LINUX",
    "installerSupportAlert": false,
    "state": "RUNNING"
  },
...

```

This is a oneliner to get the overview of your hosts:

```markup
curl -XGET -H "Authorization: api-token $APITOKEN" "$TENANT/api/v2/entities?entitySelector=type(HOST)&fields=properties.detectedName,properties.monitoringMode,properties.memoryTotal,properties.isMonitoringCandidate,tags,managementZones&pageSize=1000" |jq '.'

```
