# ActiveGate plugins: sending events to other entities or any way to determine the environment/tenant ID?

**URL:** <https://community.dynatrace.com/t/activegate-plugins-sending-events-to-other-entities-or-any-way-to-determine-the-environment-tenant-id/21170>\
**Category:** Extensions\
**Tags:** extensions\
**Created:** [January 11, 2021, 4:11pm UTC](https://community.dynatrace.com/t/activegate-plugins-sending-events-to-other-entities-or-any-way-to-determine-the-environment-tenant-id/21170 "2021-01-11T16:11:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [January 11, 2021, 4:11pm UTC](https://community.dynatrace.com/t/activegate-plugins-sending-events-to-other-entities-or-any-way-to-determine-the-environment-tenant-id/21170/1 "2021-01-11T16:11:16Z")

</div>

Hello,

I’m writing an extensive ActiveGate Plugin and would require two things (best without any additional configuration to make it reusable in an automatic fashion).

1. Is there a way to send events to other dynatrace entities other than processgroups, processes or hosts? Say I want to send events to synthetic monitor entities directly via the plugin (and not via the Dynatrace API being called from within the plugin to avoid any additional remote API calls)
2. Is there a way to get the environment/tenantID the executing AG reports to from within the AG Plugin code? It seems that the plugin SDK is also using some “helper” functions to determine this when deploying plugins, but can this be used from within the plugin itself. Are there any helper programs installed with the AG to do so or are these installed with the plugin SDK?

Thanks,

Reinhard

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [January 11, 2021, 4:21pm UTC](https://community.dynatrace.com/t/activegate-plugins-sending-events-to-other-entities-or-any-way-to-determine-the-environment-tenant-id/21170/2 "2021-01-11T16:21:33Z")

</div>

Hi Reinhard,

1. That’s not possible without calling the API from within the extension.

2. You can either request it in the configuration (that’s what we usually do), or you could pick it up from the ruxitagent.conf file.

Mike

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [January 11, 2021, 4:27pm UTC](https://community.dynatrace.com/t/activegate-plugins-sending-events-to-other-entities-or-any-way-to-determine-the-environment-tenant-id/21170/3 "2021-01-11T16:27:08Z")

</div>

Thanks for confirming, Mike!

That’s unfortunately what I feared, seems a bit counter intuitive to add the tenantid to the plugin configuration in the very same environment one configures the plugin. I will try to maybe find a more sophisticated way to automate it.

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [January 11, 2021, 4:29pm UTC](https://community.dynatrace.com/t/activegate-plugins-sending-events-to-other-entities-or-any-way-to-determine-the-environment-tenant-id/21170/4 "2021-01-11T16:29:20Z")

</div>

The user that executes extensions should have access to the ruxitagent.conf file. I’d go with that if I were you.

Seeing as you’re on the AG and you have the tenant id you could route the API calls via the AG, that way the user only needs to provide an API token in the config.

---

<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 11, 2021, 5:45pm UTC](https://community.dynatrace.com/t/activegate-plugins-sending-events-to-other-entities-or-any-way-to-determine-the-environment-tenant-id/21170/5 "2021-01-11T17:45:54Z")

</div>

In case you are routing requests via local ActiveGate you will likely encounter certificate issues as ActiveGates typically have self-signed cert (default). If you supply your own one, you will have to deal with the CA certificate in your extension code anyway, unless your ActiveGate has a certificate issued by a common CA.

Too bad the extension framework does not have the capability to access API directly … I hope for improvements in the extensions 2.0.

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [January 11, 2021, 5:49pm UTC](https://community.dynatrace.com/t/activegate-plugins-sending-events-to-other-entities-or-any-way-to-determine-the-environment-tenant-id/21170/6 "2021-01-11T17:49:47Z")

</div>

When using localhost or 127.0.0.1 I think it’s quite safe to ignore the SSL certificate.

Extensions Framework 2.0 is scheduled to add functionality such as sending data to any entity and custom configuration. That’ll hopefully resolve most use cases already without having to go via the API.
