26 Aug 2025 07:26 AM
Morning
I am just after some advice or best practice on how to deal with suppression of problems during monthly windows OS patching.
The OS server patching times and dates vary every month so setting up a constant maintenance window is not straight forward. What would i like to achieve is for host to go into maintenance mode just before patching and end once server has rebooted and finished its patch.
I think this can be achieved via API, however as i have never used or setup API integration before in Dynatrace just wondered if has anyone know the basic steps or advice on how to setup this. Or a better alterative way than API to achieve this?
Thanks in advance for your support.
Solved! Go to Solution.
26 Aug 2025 07:52 AM
You can try this:
setup all time maintenance window for whole environment just for entities tagged with some specific tag, f.e. "PatchMaint".
On host where patching is to be performed, use command line to setup tag: .\oneagentctl.exe --set-host-tag=PatchMaint
After patching is done and server reboots, run tag removal from that host: .\oneagentctl.exe --remove-host-tag=PatchMaint
26 Aug 2025 01:16 PM
I think this is the most simple and effective solution for this case.
You will need to access the host to apply the patching anyway (manually or thru automation), so you just need to include the commands to add/remove the tag before and after the patching process.
Great solution, @rastislav_danis 👏
26 Aug 2025 07:53 AM
@JordanGreen You can use workflows as an option to send a HTTP request to the API. Settings API is the one you should be using and the parameters that needs to be included are listed below
https://docs.dynatrace.com/docs/shortlink/api-v2-settings-post-object
26 Aug 2025 09:04 AM
Hi @JordanGreen ,
As @p_devulapalli mentioned above, you can use API to post maintenance windows to Dynatrace but however there's a catch here.
If you want to do this host-wise you need to provide the Host-ID as in Dynatrace, not the hostname.
example:
"scope": {
"entities": [
"HOST-1A2B3C4E5F6G7H8I"
]
Assuming you're sending this API from somewhere outside of dynatrace, you'll not have this Id.
Other alternative is to tag the entities or use ManagementZone filter.
Regards,
@Maheedhar_T