cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Run custom command with Dynatrace plugin

kay_koedel1
Newcomer

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

output = subprocess.check_output 

or for example or with

cmd = somethind_to_execute
result_code = os.system(cmd)

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

 

3 REPLIES 3

radek_j
Dynatrace Helper
Dynatrace Helper

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?


kay_koedel1
Newcomer

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?


radek_j
Dynatrace Helper
Dynatrace Helper

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

https://www.dynatrace.com/support/help/technology-support/operating-systems/linux/installation/customize-oneagent-installation-on-linux/


Featured Posts