# Enable Infra Only mode at large scale

**URL:** <https://community.dynatrace.com/t/enable-infra-only-mode-at-large-scale/38411>\
**Category:** Open Q&A\
**Tags:** installation, dynatrace-saas, oneagent, hosts-classic\
**Created:** [February 13, 2023, 8:54am UTC](https://community.dynatrace.com/t/enable-infra-only-mode-at-large-scale/38411 "2023-02-13T08:54:04Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Walter2](https://avatars.discourse-cdn.com/v4/letter/w/ecc23a/32.png) [@Walter2](https://community.dynatrace.com/u/Walter2)\
**Post date:** [February 13, 2023, 8:54am UTC](https://community.dynatrace.com/t/enable-infra-only-mode-at-large-scale/38411/1 "2023-02-13T08:54:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ramanan\_16](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@Ramanan\_16](https://community.dynatrace.com/u/Ramanan_16)\
**Post date:** [February 13, 2023, 11:15am UTC](https://community.dynatrace.com/t/enable-infra-only-mode-at-large-scale/38411/2 "2023-02-13T11:15:39Z")

</div>

Hi Walter,

Use shell/powershell script to execute the “oneagentctl” command on remote servers.

- **Linux** &nbsp;or&nbsp; **AIX** :  
./oneagentctl --set-infra-only=true
- **Windows** :  
.\oneagentctl.exe --set-infra-only=true

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [February 13, 2023, 11:31am UTC](https://community.dynatrace.com/t/enable-infra-only-mode-at-large-scale/38411/3 "2023-02-13T11:31:43Z")

</div>

Hello&nbsp;[@Walter2](https://community.dynatrace.com/user/47852)

I did not try by myself but you can give it a try. Have a look at the below link for the&nbsp;configuredMonitoringMode

> **[OneAgent on a host - GET a list of hosts with OneAgent details](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/oneagent-on-a-host/get-all-hosts-with-oneagents)**
>
> Check the configuration of OneAgent instances on your hosts via Dynatrace API.

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![Walter2](https://avatars.discourse-cdn.com/v4/letter/w/ecc23a/32.png) [@Walter2](https://community.dynatrace.com/u/Walter2)\
**Post date:** [February 13, 2023, 11:46am UTC](https://community.dynatrace.com/t/enable-infra-only-mode-at-large-scale/38411/4 "2023-02-13T11:46:54Z")

</div>

yes im trying to run a script with&nbsp;&nbsp;.\oneagentctl.exe --set-infra-only=true, its only thing i know, but wanted to try from Dynatrace API.

---

<div class="post-metadata">

**Author:** ![Walter2](https://avatars.discourse-cdn.com/v4/letter/w/ecc23a/32.png) [@Walter2](https://community.dynatrace.com/u/Walter2)\
**Post date:** [February 13, 2023, 11:47am UTC](https://community.dynatrace.com/t/enable-infra-only-mode-at-large-scale/38411/5 "2023-02-13T11:47:27Z")

</div>

I´ll see it, thank you!!!

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [February 14, 2023, 9:12pm UTC](https://community.dynatrace.com/t/enable-infra-only-mode-at-large-scale/38411/6 "2023-02-14T21:12:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Walter2](https://avatars.discourse-cdn.com/v4/letter/w/ecc23a/32.png) [@Walter2](https://community.dynatrace.com/u/Walter2)\
**Post date:** [March 6, 2023, 2:46pm UTC](https://community.dynatrace.com/t/enable-infra-only-mode-at-large-scale/38411/7 "2023-03-06T14:46:11Z")

</div>

Thank you!!!

---

<div class="post-metadata">

**Author:** ![HeyEngineer](https://avatars.discourse-cdn.com/v4/letter/h/53a042/32.png) [@HeyEngineer](https://community.dynatrace.com/u/HeyEngineer)\
**Post date:** [October 1, 2024, 6:55pm UTC](https://community.dynatrace.com/t/enable-infra-only-mode-at-large-scale/38411/8 "2024-10-01T18:55:11Z")

</div>

What if I have 400 host? How would we accomplish that in one statement?

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [October 1, 2024, 8:54pm UTC](https://community.dynatrace.com/t/enable-infra-only-mode-at-large-scale/38411/9 "2024-10-01T20:54:33Z")

</div>

Hello [@HeyEngineer](https://community.dynatrace.com/user/73347) 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.

---

<div class="post-metadata">

**Author:** ![Malaik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/malaik/32/32673_2.png) [@Malaik](https://community.dynatrace.com/u/Malaik)\
**Post date:** [October 2, 2024, 6:42am UTC](https://community.dynatrace.com/t/enable-infra-only-mode-at-large-scale/38411/10 "2024-10-02T06:42:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [October 2, 2024, 1:22pm UTC](https://community.dynatrace.com/t/enable-infra-only-mode-at-large-scale/38411/11 "2024-10-02T13:22:24Z")

</div>

I also add an [idea](https://community.dynatrace.com/post/257813)&nbsp; to add new scopes to the settings objects API. You can vote to be considered by the Dynatrace team.

---

<div class="post-metadata">

**Author:** ![Peter\_Youssef](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/peter_youssef/32/14668_2.png) [@Peter\_Youssef](https://community.dynatrace.com/u/Peter_Youssef)\
**Post date:** [October 2, 2024, 9:24pm UTC](https://community.dynatrace.com/t/enable-infra-only-mode-at-large-scale/38411/12 "2024-10-02T21:24:48Z")

</div>

Hi&nbsp;[@Walter2](https://community.dynatrace.com/user/47852)

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

1. [ansible](https://docs.dynatrace.com/docs/setup-and-configuration/dynatrace-oneagent/deployment-orchestration/ansible)
2. [puppet](https://docs.dynatrace.com/docs/setup-and-configuration/dynatrace-oneagent/deployment-orchestration/puppet)

KR,  
Peter.
