Hi @Zoltan_Toma you cannot assign an MZ during installation. The most direct approach is to set a host group rule in the MZ and when you install the host use the parameter to assign the host group. This ensures that the host is added to the MZ. I leave you the link with the parameters.
There is one way around this, which is a workaround. You can automate the deployment of OA and in the deployment custom script you can configure the creation of MZ and other configuration using the available API in Dynatrace. Directly in the installer this is not possible as @DanielS mentioned.
Thank you for your answers. I was afraid that this would be the answer, but then I have to solve it with a workaround.
This could be a product improvement idea. Introduce a set-management zone flag to the OneAgent installer. Like:
```
Dynatrace-OneAgent-installer.sh --set-management-zone=“Prod”
If a User is restricted to only have access to a specific management zone, then they will not see the newly introduced OneAgent until someone sets the correct management zone for them.
@Zoltan_Toma You should use tags (or host properties) for that which you will use in your management zone rule. You can specify host tags during OneAgent installation and also afterwards using oneagentctl.
If you are adding hosts (or processes by a host) to a management zone you are doing it wrong. It would be best if you designed your tagging and metadata concept and management zones for your environment properly so that you leverage the automation benefits Dynatrace provides.
Management zones just describe the scope. Nothing else. MZ can have up to 150 rules (same as auto tags). You can use tags or host properties, you can set it during OneAgent installation (or afterwards) as the condition.
The entity is always in the Management Zone if it matches any of the Management zone rules. So basically if you install the OneAgent and it is not included in a zone, you have your Management zone rules badly designed.
It seems like you need some design advice for properly designing your OneAgent onboarding process.