cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Monaco: Maintenance Window Creation Automation

Jordi2
Visitor

 

Hello, I am seeking assistance with the following challenge we are encountering.

Context

Our goal is to automate the creation of maintenance windows (MW). We receive MW requests through our CMDB, which we can extract as JSON, and then use this data to create MWs in Dynatrace.

We started implementing this using Monaco within a Python script, which successfully deploys a MW.

Current Logic of the Script

The script loops through the MWs in the JSON file extracted from our CMDB. For each MW, it sets the appropriate values as environment variables for Monaco to use with the mw.yaml file shown below.

mw.yamlmw.yaml

The mw.json file shown below contains the configuration values needed for each MW, depicted below.

mw.jsonmw.json

Problem We Encounter

Since the maintenanceWindowId (id in mw.yaml) is static, each iteration creates and deploys the same actual MW in Dynatrace—essentially updating the same existing MW rather than creating new ones. This is because, to my understanding, the id is specific to Monaco CLI as a unique reference to a specific Dynatrace entity.

My Questions

  • What workaround exists for this?
    • Can I make the id dynamic, similar to how other parameters are dynamically updated between iterations by changing the corresponding environment variable?
  • Is Monaco suitable for this kind of use case?
    • Is performing direct calls to Dynatrace's API a better approach?

Note that a possible solution could be editing the mw.yaml file during each iteration to assign a unique identifier. However, I prefer to keep mw.yaml as a generic template, and writing to a file each time isn't very time-efficient.

 

Thank you for your consideration. Please don't hesitate to ask if you need any additional information about the script setup.

2 REPLIES 2

AntonPineiro
DynaMight Guru
DynaMight Guru

Hi,

I would say creating a unique identifier each time.

Or not using Monaco, make direct calls to API, I think you do not to play with IDs in that way.

Or using workflows to call CMDB, get data, and create maintance windows.

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

Hi,

Thanks for your feedback.

I have implemented it using the API instead of Monaco and, indeed, this removes the id problem.

Kind regards

Featured Posts