cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Retrieve host total memory via API

andre_vdveen
DynaMight Champion
DynaMight Champion

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? What about the newly introduced 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.


7 REPLIES 7

jerry_gassie
Newcomer

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


jeff_rowell
Helper

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?


handjojo_sebast
Newcomer

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

AntonioSousa
DynaMight Guru
DynaMight Guru

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 ?

Yep 😛 haha

MaciejNeumann
Community Team
Community Team

Sharing this information from @Julius_Loman from the related Product Idea:

This is possible now through Monitored entities v2 API.

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

{
  "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:

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 '.'

 

If you have any questions about the Community, you can contact me at maciej.neumann@dynatrace.com

Featured Posts