31 Mar 2025
07:58 AM
- last edited on
15 Dec 2025
11:47 AM
by
Michal_Gebacki
Hello,
I'm currently build a script that allows us to quickly setup a new application we want to onboard. The goal is to build a sceleton configuration with all important pieces including permissions.
Application, URL mapping, storage buckets, management zone ect.. all find. One important piece is the host group and there doesn't seem to be a REST endpunkt for managing host groups.
Can you confirm that or am I simply overlooking something?
regards,
Günter
Solved! Go to Solution.
31 Mar 2025 08:12 AM - edited 31 Mar 2025 08:13 AM
That's correct, there is no API for managing hostgroups. Host groups get automatically created when you set them in the OneAgent installer arguments, in the OneAgent configuration using oneagentctl, by changing them in Deployment status or by using OneAgent configuration API.
31 Mar 2025 12:20 PM
That's major disappointment. Host groups are useful config items that are reused in other parts of a configuration, eg. Management Zones, Mainteance Windows, Logs Ingest Rules, Bucket assignment.. also in Policies for boundaries definitions ect.
In our case I simply cannot build a proper starting configuration without a new host group. Connecting / changing an agent to create a new group seems like a very silly workaround to me.
I'll create a product idea for this.
31 Mar 2025 12:32 PM
API Endpoint for Host Groups - Dynatrace Community - please vote 😉
31 Mar 2025 02:38 PM
@gschramm I'm curious about what you are trying to accomplish. You can still create rules such as tagging rules, or management zones referring to a host group name even when such a host group does not exist yet.
24 Feb 2026 06:29 PM
One use case could be maintenance windows. For example, I have a few agents that I need to deploy however, they will not be in production until a certain time. If I was able to create an 'empty host group', I could configure my maintenance window based on that host group. Then when those agents are deployed, they should automatically be in maintenance mode.
30 Mar 2026 02:54 PM
My use case : create a new host-group with specifics settings before to install OneAgent. I need to desactivate some monitoring features to the new host group only.
How can i do that ?
I do not understand how this page can help : The solution https://docs.dynatrace.com/managed/shortlink/api-v2-remote-configuration-oneagents-post-job
I do not have entities ID because OneAgent is not installed yet on the new hosts.
I'am interested if you have un curl example
01 Apr 2026 09:16 AM
I'm answering my own question (with Jean-Louis's help). And in case it's helpful to others :
To list Host_Groups, you can use the entities API with the following entitySelector configuration: type(HOST_GROUP)
/api/v2/entities?entitySelector=type%28HOST_GROUP%29
Example :
curl -s "${DT_TENANT_URL}api/v2/entities?entitySelector=type%28HOST_GROUP%29" -X GET -H 'Accept: application/json; charset=utf-8' -H
'Content-Type: application/json; charset=utf-8' -H "Authorization: Api-Token ${DT_TENANT_TOKEN}"
and then, you can modify a specific host group with it's ID ("scope":"HOST_GROUP-ID") in api/v2/settings/objects
curl "${DT_TENANT_URL}api/v2/settings/objects" \
-X POST \
-H "Accept: application/json; charset=utf-8" \
-H "Content-Type: application/json; charset=utf-8" \
-H "Authorization: Api-Token ${DT_TENANT_TOKEN}" \
-d $'[{"schemaId":"builtin:process.process-monitoring","schemaVersion":"0.2","scope":"HOST_GROUP-ID","value":{"autoMonitoring":false}}]'
However, you cannot create a host group without a host; it must be associated with at least one host.
Featured Posts