# Clear oneagentctl set agent

**URL:** <https://community.dynatrace.com/t/clear-oneagentctl-set-agent/36420>\
**Category:** Open Q&A\
**Tags:** activegate, oneagent\
**Created:** [September 2, 2022, 2:41am UTC](https://community.dynatrace.com/t/clear-oneagentctl-set-agent/36420 "2022-09-02T02:41:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stanley](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@Stanley](https://community.dynatrace.com/u/Stanley)\
**Post date:** [September 2, 2022, 2:41am UTC](https://community.dynatrace.com/t/clear-oneagentctl-set-agent/36420/1 "2022-09-02T02:41:28Z")

</div>

This question is similar to

[https://community.dynatrace.com/t5/Dynatrace-Open-Q-A/oneagentctl-set-server/m-p/115897](https://community.dynatrace.com/post/115897)

How do we clear oneagentctl set-server parameter?

Looking through doc

> **[OneAgent configuration via command-line interface](https://docs.dynatrace.com/docs/ingest-from/dynatrace-oneagent/oneagent-configuration-via-command-line-interface)**
>
> Learn how to perform some OneAgent configuration tasks without the need to reinstall OneAgent.

Some of the parameters have the option to set “” to clear the set value but for set-server we cannot?

If i initially set an activegate, and no longer use it, how do we get oneagent to communicate directly to the Dynatrace SaaS endpoint?

---

<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 2, 2022, 5:09am UTC](https://community.dynatrace.com/t/clear-oneagentctl-set-agent/36420/2 "2022-09-02T05:09:51Z")

</div>

Downloaded OneAgent installers contain already list of valid endpoint connections in your environment (SaaS cluster + ActiveGates) and are updated regularly. OneAgents are regularly updated in case of changes. If you remove an ActiveGate, it gets removed from the list. There is no need to run the oneagentctl and the OneAgent will try other connections prioritizing ActiveGates before SaaS or Managed Clusters. So it will automatically connect to Dynatrace clusters if you for example have one ActiveGate and you remove it.

The oneagentctl set-server is used when for example you are in an isolated environment and you must reach your ActiveGate or server on different IP address than the one known (NAT is used for example) or you are migrating your OneAgent to a different Dynatrace environment (in that case you must also change the environment token)
