Hello Accidentally I deployed all my servers at full stack, and i wanted to configure all them in Infra Only mode at once, because i have a 400 hundred deployed!!!
Hi Walter,
Use shell/powershell script to execute the “oneagentctl” command on remote servers.
- Linux or AIX:
./oneagentctl --set-infra-only=true - Windows:
.\oneagentctl.exe --set-infra-only=true
Hello @Walter2
I did not try by myself but you can give it a try. Have a look at the below link for the configuredMonitoringMode
Regards,
Babar
yes im trying to run a script with .\oneagentctl.exe --set-infra-only=true, its only thing i know, but wanted to try from Dynatrace API.
I´ll see it, thank you!!!
The way to do what you want is using the Settings Objects API
- You need to obtain the list of HOST ID’s
- Then you can invoke the API
{{baseUrl}}/settings/objects?validateOnly=false
If you use validateOnly in true, is a pre check of payload. - In the body you need to pass this JSON like:
[
{
“schemaId”: “builtin:host.monitoring”,
“value”: {
“enabled”: true,
“fullStack”: false,
“autoInjection”: true
},
“schemaVersion”: “1”,
“scope”: “HOST-74B800156D4D1103”
}
] - And that’s all the magic, iterate until finished.
Thank you!!!
What if I have 400 host? How would we accomplish that in one statement?
Hello @HeyEngineer is not posible on only 1 statement, in step 1 you gather all the necessary HOST ID’s, with a little scripting you set in 3 what is next to scope as a variable, and FOR EACH HOST ID’s in your list, it could be a text file you iterate the API call until finish.
You can use an external tool like POSTMAN and pass a csv or text file with all Host IDs and loop
when you have 1 execution working with postman, very easy to loop.
I also add an idea to add new scopes to the settings objects API. You can vote to be considered by the Dynatrace team.