question

Kay K. avatar image
Kay K. asked ·

Run Custom command with dynatrace plugin

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?

configurationextensionsdocumentation
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Radoslaw J. avatar image
Radoslaw J. answered ·

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/

Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Radoslaw J. avatar image
Radoslaw J. answered ·

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?

Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Kay K. avatar image
Kay K. answered ·

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?

Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Space Topics

mobile monitoring dotnet synthetic monitoring reports iis chat kubernetes servicenow amazon web services mysql mainframe rest api errors cassandra dashboard oneagent sdk cmc application monitoring openkit smartscape request attributes monitoring developer community user tagging log monitoring services ufo syntheticadvisory activegate ip addresses auto-detection high five award oracle hyperion webserver uem usql iib test automation license web performance monitoring ios news migration management zones index ibm mq web services custom event alerts notifications sso host monitoring knowledge sharing reports browser monitors java hybris sap vmware maintenance window user action naming javascript appmon ai synthetic classic availability tipstricks automation extensions session replay diagnostic tools permissions davis assistant faq documentation problem detection http monitors server easytravel apdex aws-quickstart network docker tags and metadata cloud foundry google cloud platform synthetic monitoring process groups account usability dynatrace saas gui paas openshift key user actions administration user actions postgresql synthetic locations oneagent security Dynatrace Managed user management custom python technologies mongodb openstack user session monitoring continuous delivery citrix configuration alerting NGINX action naming linux nam installation masking error reporting database mission control jmeter recorder apache mobileapp RUM php threshold azure purepath davis scripting agent aix nodejs android