<?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 Re: How do I get hostid using API in Dynatrace API</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/184307#M1818</link>
    <description>&lt;P&gt;The &lt;A href="https://www.dynatrace.com/support/help/dynatrace-api/environment-api/topology-and-smartscape/hosts-api/get-all" target="_self"&gt;Hosts API&lt;/A&gt; will also do the job.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Apr 2022 12:07:12 GMT</pubDate>
    <dc:creator>dannemca</dc:creator>
    <dc:date>2022-04-07T12:07:12Z</dc:date>
    <item>
      <title>Get host ID using API</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/184277#M1816</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I need help to find a way to get hostid using an API. I know hostid can be found on the URL like this:&lt;/P&gt;
&lt;P data-unlink="true"&gt;https://my-domain/e/my-environment/#newhosts/hostdetails;id=HOST-B0363C0D000000000;gtf=-72h%20to%20now;gf=all&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I need to have a way to query from the OneAgent host itself so that I can use it to trigger enable/disable API from there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Gary&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2025 07:43:58 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/184277#M1816</guid>
      <dc:creator>gary1024</dc:creator>
      <dc:date>2025-03-21T07:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get hostid using API</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/184283#M1817</link>
      <description>&lt;P&gt;You can use the&amp;nbsp;&lt;A href="https://www.dynatrace.com/support/help/dynatrace-api/environment-api/entity-v2/get-entities-list" target="_self"&gt;Monitored Entities Endpoint in the Environment v2 API&lt;/A&gt;&amp;nbsp;to get the Host IDs&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 09:23:19 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/184283#M1817</guid>
      <dc:creator>pahofmann</dc:creator>
      <dc:date>2022-04-07T09:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get hostid using API</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/184307#M1818</link>
      <description>&lt;P&gt;The &lt;A href="https://www.dynatrace.com/support/help/dynatrace-api/environment-api/topology-and-smartscape/hosts-api/get-all" target="_self"&gt;Hosts API&lt;/A&gt; will also do the job.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 12:07:12 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/184307#M1818</guid>
      <dc:creator>dannemca</dc:creator>
      <dc:date>2022-04-07T12:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get hostid using API</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/184366#M1819</link>
      <description>&lt;P&gt;Thanks for the reply. Sorry for not being specific.&lt;/P&gt;&lt;P&gt;A list of HOSTID and other parameters will not help.&lt;/P&gt;&lt;P&gt;My use case is that I need to configure my AWS instance to query the HOSTID of the instance in Dynatrace (by its Instance-ID or detected name) and store it in a variable to be use in the OneAgent enable/disable API.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 02:08:24 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/184366#M1819</guid>
      <dc:creator>gary1024</dc:creator>
      <dc:date>2022-04-08T02:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get hostid using API</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/184367#M1820</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/13094"&gt;@gary1024&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can do this using OneAgent on a host API,&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;First you need to use, &lt;STRONG&gt;/oneagents&lt;/STRONG&gt; API to get the host id (Environment API)&lt;/LI&gt;&lt;LI&gt;Second, you need to use&amp;nbsp;&lt;STRONG&gt;/hosts/{id}/monitoring&lt;/STRONG&gt; API to update the monitoringEnabled parameter. (Configuration API)&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;&lt;PRE&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;
  &lt;SPAN&gt;"monitoringEnabled"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;true&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;
  &lt;SPAN&gt;"monitoringMode"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;"FULL_STACK"&lt;/SPAN&gt;
&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Fri, 08 Apr 2022 02:30:49 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/184367#M1820</guid>
      <dc:creator>theharithsa</dc:creator>
      <dc:date>2022-04-08T02:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get hostid using API</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/184376#M1821</link>
      <description>&lt;P&gt;Hey NKIANKEONG,&lt;BR /&gt;Instead of the APIs you could also use the oneagentctl tool to get the HostID of specific hosts. It's bundled with OneAgent when you install it so it will be on every host. So you could set up some system to remotely trigger it to run and then get the response from it.&lt;BR /&gt;&lt;A href="https://www.dynatrace.com/support/help/shortlink/oneagentctl#host-id" target="_blank"&gt;https://www.dynatrace.com/support/help/shortlink/oneagentctl#host-id&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 04:17:43 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/184376#M1821</guid>
      <dc:creator>Fin_Ubels</dc:creator>
      <dc:date>2022-04-08T04:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get hostid using API</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/184378#M1822</link>
      <description>&lt;P&gt;Thanks to everyone that contribute to this. Problem solved!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the solution:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dynatrace.com/support/help/dynatrace-api/environment-api/entity-v2/get-entities-list?_ga=2.213797524.1882343407.1649305572-1936452222.1646239584&amp;amp;_gac=1.247131824.1649056799.EAIaIQobChMItvL9--T59gIVZJNmAh0CfQGfEAAYASACEgKfRfD_BwE" target="_blank" rel="noopener"&gt;environment-api/entity-v2/get-entities-list&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this simple API will get me the HOSTID I need:&lt;/P&gt;&lt;P data-unlink="true"&gt;https://{my-domain}/e/{my-environment}/api/v2/entities?Api-Token={my-token}&amp;amp;entitySelector=type(%22HOST%22),entityName(%22{my-detected-name}%22)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result:&lt;/P&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;P&gt;totalCount: 1&lt;BR /&gt;pageSize: 50&lt;BR /&gt;entities:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; entityId: "HOST-xxxxxxxxxxxxxxx"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; displayName: "MicroServices - ip-xx-xxx-xx-xx.aws.men.maxis.com.my"&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;TABLE cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 08 Apr 2022 04:50:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/184378#M1822</guid>
      <dc:creator>gary1024</dc:creator>
      <dc:date>2022-04-08T04:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get hostid using API</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/206592#M2333</link>
      <description>&lt;P&gt;It is so complicated to find so simple information . It is not user friendly .&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 01:02:41 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/206592#M2333</guid>
      <dc:creator>vzd68890</dc:creator>
      <dc:date>2023-03-09T01:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get hostid using API</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/273047#M3674</link>
      <description>&lt;P&gt;Hi. I see that this thread is already closed, but in case someone is useful, it is a good idea to filter only for those hosts that are being monitored (we discard all ESXi discovered in vCenter) and by the way, not return only 50 results and can specify the number we want. This is the call to return the ID of each server, (necessary to use the API) only if it is in “FULL-STACK” and returning 100 results.&lt;/P&gt;
&lt;P data-unlink="true"&gt;url = 'https://{environmentid}.live.dynatrace.com/api/v2/entities?entitySelector=type%28%22HOST%22%29,monitoringMode(%22FULL_STACK%22)&amp;amp;pageSize=100'&lt;/P&gt;
&lt;P&gt;In our case we use it to enable or disable by API the monitoring of HOSTs through a python script.&lt;BR /&gt;Greetings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2025 07:44:20 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Get-host-ID-using-API/m-p/273047#M3674</guid>
      <dc:creator>v_mayordomo</dc:creator>
      <dc:date>2025-03-21T07:44:20Z</dc:date>
    </item>
  </channel>
</rss>

