# Activating of deep monitoring via UI or API

**URL:** <https://community.dynatrace.com/t/activating-of-deep-monitoring-via-ui-or-api/34862>\
**Category:** Open Q&A\
**Tags:** oneagent\
**Created:** [April 18, 2022, 12:47pm UTC](https://community.dynatrace.com/t/activating-of-deep-monitoring-via-ui-or-api/34862 "2022-04-18T12:47:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JAR](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@JAR](https://community.dynatrace.com/u/JAR)\
**Post date:** [April 18, 2022, 12:47pm UTC](https://community.dynatrace.com/t/activating-of-deep-monitoring-via-ui-or-api/34862/1 "2022-04-18T12:47:54Z")

</div>

Hello.  
I have installed several oneagents in _infraonly =TRUE_&nbsp;&nbsp;and _set-auto-injection-enabled=false_.

But now I need to see metrics of the processes running on these hosts.

I have tried to change the configuration via UI and [API](https://www.dynatrace.com/support/help/shortlink/api-config-oneagent-on-host-monitoring-put#request-body-objects); but the only way to change it is through _oneagentctl_?

Am I doing something wrong? or is it an error in the documentation?

Thanks in advance

BR  
Jose A

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [April 18, 2022, 3:29pm UTC](https://community.dynatrace.com/t/activating-of-deep-monitoring-via-ui-or-api/34862/2 "2022-04-18T15:29:19Z")

</div>

To change the deep monitoring configuration you can use

- [oneagentctl](https://www.dynatrace.com/support/help/shortlink/oneagentctl#infrastructure-monitoring)&nbsp;as mentioned
- [OneAgent on Host Monitoring configuration API](https://www.dynatrace.com/support/help/shortlink/api-config-oneagent-on-host-monitoring)
- In the UI on the particular hosts

Just note, that application processes to be deep monitored must be restarted after the change is applied.

---

<div class="post-metadata">

**Author:** ![JAR](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@JAR](https://community.dynatrace.com/u/JAR)\
**Post date:** [April 18, 2022, 3:48pm UTC](https://community.dynatrace.com/t/activating-of-deep-monitoring-via-ui-or-api/34862/3 "2022-04-18T15:48:40Z")

</div>

Thanks [Julio](https://community.dynatrace.com/user/3364).  
That’s right, there are 3 way to do it.

But what happens is this:  
I installed oneagent using the command line:  
_bin/sh Dynatrace-OneAgent-Linux.sh --set-infra-only=true --set-auto-injection-enabled=false_

and now i´m trying to deepen monitoring. Using UI or API ways i see same result:

| **Activation of deep monitoring was unsuccessful**  
OneAgent auto-injection was manually disabled on this host |

I think if I enable deep-monitoring via commandline, the only way to changeit is using the command line: oneagentctl

I hope I have clarified my situation

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [April 18, 2022, 4:26pm UTC](https://community.dynatrace.com/t/activating-of-deep-monitoring-via-ui-or-api/34862/4 "2022-04-18T16:26:17Z")

</div>

[@JAR](https://community.dynatrace.com/user/48634)&nbsp;ok, I finally understand your question now.

There are two settings here:

- infra-only mode
- auto injection

The auto-injection is your issue here. The local setting on OneAgent using installation or oneagentctl has precedence over the setting that the OneAgent receives from Dynatrace server. It also shows you that in the UI:

 ![Julius_Loman_0-1650298897983.png](https://global.discourse-cdn.com/dynatrace/original/2X/d/d08d6586406c66081a1403499aad431871069a9c.png)

You should not disable auto-injection unless it’s really required for some reason. More on that [in the docs](https://www.dynatrace.com/support/help/shortlink/oneagentctl#injection-toggle).

So in your situation, you need to apply the oneagentctl command on the hosts to enable process injection. Switching to full-stack monitoring (which indeed requires injection) can be then achieved from the UI or API.

---

<div class="post-metadata">

**Author:** ![Romanenkov\_Al3x](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/romanenkov_al3x/32/36257_2.png) [@Romanenkov\_Al3x](https://community.dynatrace.com/u/Romanenkov_Al3x)\
**Post date:** [February 18, 2024, 8:34am UTC](https://community.dynatrace.com/t/activating-of-deep-monitoring-via-ui-or-api/34862/5 "2024-02-18T08:34:06Z")

</div>

[@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp;&nbsp;Thanks for detailed answers in this and others threads.With my own tests and detailed description here, it solves my questions.&nbsp;👍

---

<div class="post-metadata">

**Author:** ![fstekelenburg](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/fstekelenburg/32/22029_2.png) [@fstekelenburg](https://community.dynatrace.com/u/fstekelenburg)\
**Post date:** [May 6, 2024, 11:46am UTC](https://community.dynatrace.com/t/activating-of-deep-monitoring-via-ui-or-api/34862/6 "2024-05-06T11:46:00Z")

</div>

Can someone confirm that when the setting is changed on the host to false, this is not reflected in the UI? E.g. the switch is still ‘on’ and not greyed out.
