<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Using API get CPU and Memory of a host and all the host under an application in Dynatrace API</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-API/Using-API-get-CPU-and-Memory-of-a-host-and-all-the-host-under-an/m-p/167452#M1283</link>
    <description>&lt;P&gt;hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i am trying to&amp;nbsp;capture CPU and Memory of a host and all the host under an application for given time period, is this possible in DT&lt;/P&gt;</description>
    <pubDate>Tue, 29 Jun 2021 12:56:34 GMT</pubDate>
    <dc:creator>shailandra</dc:creator>
    <dc:date>2021-06-29T12:56:34Z</dc:date>
    <item>
      <title>Using API get CPU and Memory of a host and all the host under an application</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Using-API-get-CPU-and-Memory-of-a-host-and-all-the-host-under-an/m-p/167452#M1283</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i am trying to&amp;nbsp;capture CPU and Memory of a host and all the host under an application for given time period, is this possible in DT&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 12:56:34 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Using-API-get-CPU-and-Memory-of-a-host-and-all-the-host-under-an/m-p/167452#M1283</guid>
      <dc:creator>shailandra</dc:creator>
      <dc:date>2021-06-29T12:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using API get CPU and Memory of a host and all the host under an application</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Using-API-get-CPU-and-Memory-of-a-host-and-all-the-host-under-an/m-p/167603#M1290</link>
      <description>&lt;P&gt;Hi Shailandra,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, this is possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pulling metrics out of Dynatrace can be done with the Metrics API:&lt;BR /&gt;&lt;A href="https://www.dynatrace.com/support/help/dynatrace-api/environment-api/metric-v2/get-data-points/" target="_blank"&gt;https://www.dynatrace.com/support/help/dynatrace-api/environment-api/metric-v2/get-data-points/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Depending on the type of host, there may be a different metric that is used for CPU or Memory, but all Host/Infrastructure metrics are listed here:&lt;BR /&gt;&lt;A href="https://www.dynatrace.com/support/help/shortlink/api-metrics2-available-saas#host" target="_blank"&gt;https://www.dynatrace.com/support/help/shortlink/api-metrics2-available-saas#host&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now as for grabbing all host metrics that serve a particular RUM Application, that requires a bit of configuration. You'll either want to tag each host with the name of the application it serves, or create a management zone for them. After that, you can include the tag/management zone as a filter in your request to just pull those hosts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below requests should give you the results you want after you set up your tag or management zone (replace X with your tag/management zone name or change the metricSelector metric ID if you want to pull a different metric):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/api/v2/metrics/query?metricSelector=builtin:host.mem.usage&amp;amp;entitySelector=type(HOST),tag(X)

/api/v2/metrics/query?metricSelector=builtin:host.mem.usage&amp;amp;entitySelector=type(HOST),mzName(X)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 18:52:21 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Using-API-get-CPU-and-Memory-of-a-host-and-all-the-host-under-an/m-p/167603#M1290</guid>
      <dc:creator>trevor_masseng1</dc:creator>
      <dc:date>2021-06-14T18:52:21Z</dc:date>
    </item>
  </channel>
</rss>

