# Is there any way to disable auto restart of Oneagent post server reboot?

**URL:** <https://community.dynatrace.com/t/is-there-any-way-to-disable-auto-restart-of-oneagent-post-server-reboot/41563>\
**Category:** Open Q&A\
**Tags:** oneagent\
**Created:** [September 7, 2023, 4:38pm UTC](https://community.dynatrace.com/t/is-there-any-way-to-disable-auto-restart-of-oneagent-post-server-reboot/41563 "2023-09-07T16:38:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![SachinJindal](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@SachinJindal](https://community.dynatrace.com/u/SachinJindal)\
**Post date:** [September 7, 2023, 4:38pm UTC](https://community.dynatrace.com/t/is-there-any-way-to-disable-auto-restart-of-oneagent-post-server-reboot/41563/1 "2023-09-07T16:38:58Z")

</div>

Is there any way to disable auto restart of Oneagent post server reboot?

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [September 7, 2023, 6:01pm UTC](https://community.dynatrace.com/t/is-there-any-way-to-disable-auto-restart-of-oneagent-post-server-reboot/41563/2 "2023-09-07T18:01:19Z")

</div>

If you turn off monitoring via the Dynatrace UI that should solve your problem

---

<div class="post-metadata">

**Author:** ![SachinJindal](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@SachinJindal](https://community.dynatrace.com/u/SachinJindal)\
**Post date:** [September 7, 2023, 8:21pm UTC](https://community.dynatrace.com/t/is-there-any-way-to-disable-auto-restart-of-oneagent-post-server-reboot/41563/3 "2023-09-07T20:21:50Z")

</div>

possible to perform using command line? so the init services which are responsible for start doesnt do anything if we disable.

---

<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:** [September 8, 2023, 9:42am UTC](https://community.dynatrace.com/t/is-there-any-way-to-disable-auto-restart-of-oneagent-post-server-reboot/41563/4 "2023-09-08T09:42:42Z")

</div>

[@SachinJindal](https://community.dynatrace.com/user/52338)&nbsp;you can stop oneagent from being started by modifying the systemd unit file (Linux) / configuring the sysv (Linux) or using services (Windows).

What is the use case here you are trying to solve? I’d not recommend disabling the startup of oneagent and prefer the UI or API method which&nbsp;[@ChadTurner](https://community.dynatrace.com/user/14877)&nbsp;suggests.

Agent disabled in Dynatrace does not perform any actions except for sending heartbeats to Dynatrace.

---

<div class="post-metadata">

**Author:** ![SachinJindal](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@SachinJindal](https://community.dynatrace.com/u/SachinJindal)\
**Post date:** [September 12, 2023, 12:26pm UTC](https://community.dynatrace.com/t/is-there-any-way-to-disable-auto-restart-of-oneagent-post-server-reboot/41563/5 "2023-09-12T12:26:58Z")

</div>

just wanted to stop the Dynatrace for quite some days&nbsp; and it shouldnt startup if Servers are rebooted assuming we dont have DT UI access

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [September 12, 2023, 2:08pm UTC](https://community.dynatrace.com/t/is-there-any-way-to-disable-auto-restart-of-oneagent-post-server-reboot/41563/6 "2023-09-12T14:08:34Z")

</div>

You can also leverage the Services portal (Assuming you have SaaS access) which lives outside your Dynatrace UI to enable/disable the oneagent.

---

<div class="post-metadata">

**Author:** ![richard\_guerra](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/richard_guerra/32/9592_2.png) [@richard\_guerra](https://community.dynatrace.com/u/richard_guerra)\
**Post date:** [September 12, 2023, 2:21pm UTC](https://community.dynatrace.com/t/is-there-any-way-to-disable-auto-restart-of-oneagent-post-server-reboot/41563/7 "2023-09-12T14:21:09Z")

</div>

Hello, Assuming Linux OS -

The doc page is here:&nbsp;[Stop/restart OneAgent on Linux](https://www.dynatrace.com/support/help/shortlink/stop-restart-oneagent-linux)&nbsp;but this doesn’t answer your specific question directly.

OneAgent is installed as a system service, so you can use systemctl commands to disable or enable, example:

$ sudo systemctl disable oneagent.service

$ sudo systemctl enable oneagent.service

You’ll need ‘root’ - with related complications. If you have root, then I’d anticipate you should be familiar with systemctl, hence please consider above advice to disable/enable from cluster side (which admittedly still lets OneAgent initiate at the OS service level).

---

<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:** [September 12, 2023, 7:55pm UTC](https://community.dynatrace.com/t/is-there-any-way-to-disable-auto-restart-of-oneagent-post-server-reboot/41563/8 "2023-09-12T19:55:15Z")

</div>

Then only way is to modify the startup of the agent itself. Not a great idea, since you can manage it from Dynatrace UI/API afterwards.  
Anyway, I don’t recommend shutting down OneAgent unless there are really very good reasons. I recommend to either get access to the UI/API so you can manage it from there. Doing manual startup changes is discouraged in general.
