23 Nov 2023 06:25 PM
I'm looking for a way to set at least one management zone right away when I install a new OneAgent.
I don't want to create a new Zone. My zones already exist. I just want to find a command line flag where I could define it.
(I'm not looking for ways to do it on the webUI or Management Zone rules.)
Solved! Go to Solution.
23 Nov 2023 06:49 PM
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.
23 Nov 2023 10:27 PM
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.
Radek
24 Nov 2023 03:56 PM
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"
```
Or as a host property like:
```
Dynatrace-OneAgent-installer.sh --set-host-property=ManagementZone="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.
26 Nov 2023 03:02 PM
Product idea has been raised.
26 Nov 2023 09:17 PM
@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.
27 Nov 2023 09:11 AM
Thank you for your response. You are right. We Are doing it wrong.
Personally, I would never suggest to use a database view-like concept to define access roles to an information system.
If I was unclear, my question was aimed at whether there is a default value for management zones.
If not, it would be nice to have a default value to avoid the problem of a new entity not being visible in a zone.
27 Nov 2023 10:09 AM
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.