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

Enable Infra Only mode at large scale

Walter2
Helper

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!!!

11 REPLIES 11

ram16
Helper

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
Ramanan Raghunathan

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.

Babar_Qayyum
DynaMight Guru
DynaMight Guru

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

https://www.dynatrace.com/support/help/dynatrace-api/environment-api/oneagent-on-host

Regards,

Babar

 

 

I´ll see it, thank you!!!

DanielS
DynaMight Guru
DynaMight Guru

The way to do what you want is using the Settings Objects API

  1. You need to obtain the list of HOST ID's
  2. Then you can invoke the API
    {{baseUrl}}/settings/objects?validateOnly=false
    If you use validateOnly in true, is a pre check of payload.
  3. 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"
    }
    ]
  4. And that's all the magic, iterate until finished.

 

The true delight is in the finding out rather than in the knowing.

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.

The true delight is in the finding out rather than in the knowing.

Malaik
DynaMight Champion
DynaMight Champion

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.

Sharing Knowledge

I also add an idea  to add new scopes to the settings objects API. You can vote to be considered by the Dynatrace team.

The true delight is in the finding out rather than in the knowing.

Peter_Youssef
Mentor

Hi @Walter2 

You can check using ansible or puppet to automate such action to save time, if such tools are available in your organization:

  1. ansible 
  2. puppet 

KR,
Peter.

Featured Posts