08 Mar 2022 08:06 PM - last edited on 14 Mar 2022 11:45 AM by MaciejNeumann
Hello,
I have just started using monaco and was able to deploy a single mgmtzone that sits alone in the project like:
project/mymgmtzones/mgmt-zone and this contains
- config.yaml
- mgmz1.json
How can i deploy multiple mgmt. zone? Based on the below it appears we can have multiple json's for a particular project?, what will be the config.yaml look like if i have another mgmt. zone like json mgmz2.json?
I have tried to duplicate the block for existing but it does not work!
refer doc here: https://dynatrace-oss.github.io/dynatrace-monitoring-as-code/configuration/configuration_structure
from the above doc:
projects/
{projectname}/
{configuration type}/
config.yaml
config1.json
config2.json
thanks
Rajeev
Solved! Go to Solution.
08 Mar 2022 08:38 PM
The JSON files are just a template. So if you have multiple zones in your project the yaml in management-zone/ folder must look like this:
config:
- zone1: zone.json
- zone2: zone.json
- zone3: another_zone_template.json
zone1:
- name: "My Zone 1"
- tag: "ZONE1"
zone2:
- name: "My Zone 2"
- tag: "ZONE2"
zone3:
- name: "My Zone 3"
In the example above I define 3 management zones. Two use the file zone.json and the third uses another file. The MZ 1 and 2 have a placeholder named tag which you must use in the zone.json file in the form:
{{ .tag }}
Or you can have also a separate JSON file for each zone - it depends on how your zones differ.
08 Mar 2022 08:59 PM - edited 08 Mar 2022 09:00 PM
Thank you Julius worked like a charm, in my case i was testing with a scenario of separate .json files.
Trying to wrap my head around the use of tags, i am assuming is to have mgmt. zones with different names but the same rule set in an env?
Rajeev
09 Mar 2022 07:48 AM
Yes, for example you have same ruleset for MZ (MZ defined by tag of hosts for example). So you create a JSON template and you supply the TAG name and the MZ name in the yaml file. So you create many management zones using the single JSON template file, just by supplying the config.
But the rulesets for the MZ is up to you and your environment.