# Display the current port that OneAgent uses from the Dynatrace tenant

**URL:** <https://community.dynatrace.com/t/display-the-current-port-that-oneagent-uses-from-the-dynatrace-tenant/49529>\
**Category:** Open Q&A\
**Tags:** oneagent\
**Created:** [December 31, 2024, 4:38pm UTC](https://community.dynatrace.com/t/display-the-current-port-that-oneagent-uses-from-the-dynatrace-tenant/49529 "2024-12-31T16:38:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![joanne\_quan](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@joanne\_quan](https://community.dynatrace.com/u/joanne_quan)\
**Post date:** [December 31, 2024, 4:38pm UTC](https://community.dynatrace.com/t/display-the-current-port-that-oneagent-uses-from-the-dynatrace-tenant/49529/1 "2024-12-31T16:38:47Z")

</div>

hello,

Is there a way to display the port that OneAgent using from the Dynatrace tenant?

Thanks

---

<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:** [December 31, 2024, 7:27pm UTC](https://community.dynatrace.com/t/display-the-current-port-that-oneagent-uses-from-the-dynatrace-tenant/49529/2 "2024-12-31T19:27:42Z")

</div>

Dynatrace OneAgent Uses 9999 From the OneAgent on the host to the ActiveGate. The ActiveGate uses 443 to connect to the Dynatrace Tenant. If you forgo the ActiveGate, your OneAgent will communicate over 443 to the Tenant directly.

> **[Supported connectivity schemes for ActiveGates](https://docs.dynatrace.com/docs/ingest-from/dynatrace-activegate/supported-connectivity-schemes-for-activegates)**
>
> Learn about the connectivity priorities between ActiveGate types as well as the priorities between ActiveGates and OneAgents.

---

<div class="post-metadata">

**Author:** ![RohitBisht](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/rohitbisht/32/38577_2.png) [@RohitBisht](https://community.dynatrace.com/u/RohitBisht)\
**Post date:** [January 2, 2025, 9:31am UTC](https://community.dynatrace.com/t/display-the-current-port-that-oneagent-uses-from-the-dynatrace-tenant/49529/3 "2025-01-02T09:31:11Z")

</div>

At the moment there is no way to do so. Curious to know the reason you need to know the port agent is running on. Could you share please.

---

<div class="post-metadata">

**Author:** ![sia\_h](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@sia\_h](https://community.dynatrace.com/u/sia_h)\
**Post date:** [January 2, 2025, 12:13pm UTC](https://community.dynatrace.com/t/display-the-current-port-that-oneagent-uses-from-the-dynatrace-tenant/49529/4 "2025-01-02T12:13:37Z")

</div>

Besides what Chad mentioned, you can list the listenPorts of the OneAgent processes:

```markup
fetch dt.entity.process_group_instance
| fields entity.name, listenPorts, softwareTechnologies
| filter matchesPhrase(softwareTechnologies, "type:DYNATRACE")
| filter isNotNull(listenPorts)

```

---

<div class="post-metadata">

**Author:** ![joanne\_quan](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@joanne\_quan](https://community.dynatrace.com/u/joanne_quan)\
**Post date:** [January 2, 2025, 2:23pm UTC](https://community.dynatrace.com/t/display-the-current-port-that-oneagent-uses-from-the-dynatrace-tenant/49529/5 "2025-01-02T14:23:45Z")

</div>

hello RohitBisht,

Thanks for your reply,&nbsp; in our case, sometimes the application/database is using the port range \> 51000 and&nbsp; OneAgent watchdog attempts to open the first available port between port 50000 and 50100.&nbsp; In this case we need to change the config file&nbsp;using the following command

./oneagentctl --set-watchdog-portrange=50000:50100

however, the port failed to connected nightly on the server due to conflict.&nbsp; So i just want to know if there is a way we can see the port that OneAgent is using without looking at the config file setup on the server.

Thanks,

Joanne

---

<div class="post-metadata">

**Author:** ![joanne\_quan](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@joanne\_quan](https://community.dynatrace.com/u/joanne_quan)\
**Post date:** [January 2, 2025, 2:25pm UTC](https://community.dynatrace.com/t/display-the-current-port-that-oneagent-uses-from-the-dynatrace-tenant/49529/6 "2025-01-02T14:25:29Z")

</div>

Thanks for your information

---

<div class="post-metadata">

**Author:** ![joanne\_quan](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@joanne\_quan](https://community.dynatrace.com/u/joanne_quan)\
**Post date:** [January 2, 2025, 2:46pm UTC](https://community.dynatrace.com/t/display-the-current-port-that-oneagent-uses-from-the-dynatrace-tenant/49529/7 "2025-01-02T14:46:08Z")

</div>

thanks for your help,&nbsp; i will try this command

---

<div class="post-metadata">

**Author:** ![sia\_h](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@sia\_h](https://community.dynatrace.com/u/sia_h)\
**Post date:** [January 2, 2025, 11:44pm UTC](https://community.dynatrace.com/t/display-the-current-port-that-oneagent-uses-from-the-dynatrace-tenant/49529/8 "2025-01-02T23:44:37Z")

</div>

You can use the DQL query I have provided to list the ports used by the OneAgent Watchdog.

Please note that with OneAgent version 1.301 the OneAgent doesn’t use the TCP ports for its own inter-process communication.

> **[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.

---

<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:** [January 6, 2025, 10:15am UTC](https://community.dynatrace.com/t/display-the-current-port-that-oneagent-uses-from-the-dynatrace-tenant/49529/9 "2025-01-06T10:15:25Z")

</div>

Currently it’s not possible to get the current “remote” port of Dynatrace AG or Environment as&nbsp;[@RohitBisht](https://community.dynatrace.com/user/45903)&nbsp;states. The best you can do is to query the [Environment Deployment API -&nbsp; connection info](https://docs.dynatrace.com/docs/shortlink/api-deployment-get-connectivity). This will provide you with all possible endpoints to which OneAgent can try to connect. Local port is always dynamic as with TCP connections. There is no way to supply local TCP port with OneAgent. Also if you have multiple deep monitored processes, each one may connect to different endpoints.&nbsp; OneAgents reconnect regularly between endpoints to load balance for example. There are options to set the endpoint (--set-server or environment variables, depending on OneAgent type), but I’d not recommend touching it unless inevitable.

The watchdog ports are something different and yes those are local ports for watchdog, you can set them, but those are not used for communication towards the cluster.
