# Run custom command with Dynatrace plugin

**URL:** <https://community.dynatrace.com/t/run-custom-command-with-dynatrace-plugin/20590>\
**Category:** Extensions\
**Tags:** extensions\
**Created:** [May 9, 2019, 9:23am UTC](https://community.dynatrace.com/t/run-custom-command-with-dynatrace-plugin/20590 "2019-05-09T09:23:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kay\_koedel1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/kay_koedel1/32/8592_2.png) [@kay\_koedel1](https://community.dynatrace.com/u/kay_koedel1)\
**Post date:** [May 9, 2019, 9:23am UTC](https://community.dynatrace.com/t/run-custom-command-with-dynatrace-plugin/20590/1 "2019-05-09T09:23:45Z")

</div>

We want to create a plugin with the Dynatrace SDK that executes a command in unix or Windows. I found out that this is not working when we upload the plugin to the server. In the simulator it works fine

```auto
output = subprocess.check_output

```

or for example or with

```auto
cmd = somethind_to_execute<br>result_code = os.system(cmd)

```

What can we do to exectue a command in the plugin?

---

<div class="post-metadata">

**Author:** ![radek\_j](https://avatars.discourse-cdn.com/v4/letter/r/c5a1d2/32.png) [@radek\_j](https://community.dynatrace.com/u/radek_j)\
**Post date:** [May 9, 2019, 10:08am UTC](https://community.dynatrace.com/t/run-custom-command-with-dynatrace-plugin/20590/2 "2019-05-09T10:08:46Z")

</div>

Can you elaborate what’s exactly is not working? Did you put your plugin in plugin\_deployment folder? Can you provide us with plugin log files?

---

<div class="post-metadata">

**Author:** ![kay\_koedel1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/kay_koedel1/32/8592_2.png) [@kay\_koedel1](https://community.dynatrace.com/u/kay_koedel1)\
**Post date:** [May 10, 2019, 8:56am UTC](https://community.dynatrace.com/t/run-custom-command-with-dynatrace-plugin/20590/3 "2019-05-10T08:56:06Z")

</div>

ok i found out thate generally subprocess it is working. My problem was that the user that executes the simulator ist “ **root** ” and the user that executes the plugin ist “ **dtuser** ”. This was missing in the documentation and made the plguin running in the sumulator but not at the server. Is ist possible to run the plugin as root?

---

<div class="post-metadata">

**Author:** ![radek\_j](https://avatars.discourse-cdn.com/v4/letter/r/c5a1d2/32.png) [@radek\_j](https://community.dynatrace.com/u/radek_j)\
**Post date:** [May 10, 2019, 10:17am UTC](https://community.dynatrace.com/t/run-custom-command-with-dynatrace-plugin/20590/4 "2019-05-10T10:17:25Z")

</div>

Due to security constraints all the plugins are executed with dtuser permissions. Indeed it’d might be good to indicate that in plugin sdk documentation explicitly. Currently it’s only mentioned in

> **[Customize OneAgent installation on Linux](https://docs.dynatrace.com/docs/ingest-from/dynatrace-oneagent/installation-and-operation/linux/installation/customize-oneagent-installation-on-linux)**
>
> Learn how to use the Linux installer with command line parameters.

---

<div class="post-metadata">

**Author:** ![MillerGEP](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@MillerGEP](https://community.dynatrace.com/u/MillerGEP)\
**Post date:** [November 19, 2025, 1:52pm UTC](https://community.dynatrace.com/t/run-custom-command-with-dynatrace-plugin/20590/5 "2025-11-19T13:52:07Z")

</div>

Hi&nbsp;[@kay\_koedel1](https://community.dynatrace.com/user/26004)&nbsp; how are you ?. Can you resolved executes the plugin ? I need a solution like this for run commands on OS LINUX, AIX and Windows.
