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

Create OneAgent custom plugin / extension : fail to command line upload on Cluster

gilles_tabary
Advisor

Hello.

 

Based on https://www.dynatrace.com/support/help/extend-dynatrace/extensions/oneagent-extensions/oneagent-exte... I built, uploaded manually on cluster, and deployed on a sand box OneAgent my custom extension. Fine.

 

Now I am trying to upload the extension on the cluster through command line as documented on https://www.dynatrace.com/support/help/extend-dynatrace/extensions/oneagent-extensions/oneagent-exte...

It says : plugin_sdk upload_plugin --plugin_zip...  --server ...

But :

  • what is supposed to be --server option value ? I cannot find this.
  • I guessed /api/v1/remoteplugins but I cannot find API tester for this : where is it ?
  • when I try to run the plugin_sdk upload_plugin --plugin_zip /tmp/custom.python.my_plugin.zip ... I get a :

 

 

server https://xxx.xxx.xxx/e/<env_id>/api/v1/remoteplugins/ returned status code: 400 {"error":{"code":400,"message":"Plugin *.zip file name should match plugin id."}}​

 

 

and I cannot make sens of this.

Does any one know how to command line upload a OneAgent custom extension ?

Regards.

7 REPLIES 7

gilles_tabary
Advisor

BTW, plugin_sdk upload_plugin tell me

Please execute oneagent_verify_plugin before upload to validate plugin.json against the schema

which

  • I did : oneagent_verify_plugin => Plugin custom.python.myplugin is valid
  • I also did : plugin_sdk verify_plugin => also says ok, and looks like it is the same command

gilles_tabary
Advisor

Also FYI :

my plugin.json  file says

{
  "name": "custom.python.my_plugin",

and my plugin file is

/tmp/custom.python.my_plugin.zip

I am puzzled.

pahofmann
DynaMight Guru
DynaMight Guru

The problem is you are uploading a OneAgent extension but have /api/v1/remoteplugin at the end of the server URL, which is for AG extensions. For oneagent extensions it is /api/v1/plugins.

 

But you can leave out the API Endpoint and enter the server as https://XXXXXX.live.dynatrace.com/  or  https://xxx.xxx.xxx/e/env_id/ and it will pick the correct API endpoint depending on if you are building an activegate or oneagent extension.

Dynatrace Certified Master - Dynatrace Partner - 360Performance.net

Hello.

Shouldn't it be someone different to set an answer as a solution ? 🙂

At least in my case this is not the solution :

plugin_sdk upload_plugin --plugin_zip custom.python.my_oneagent_plugin.zip --server https://my.dynatrace.server/e/<env_id>/ --token dt0c01....
The server endpoint https://my.dynatrace.server/e/<env_id>/ is not designed for plugin upload

plugin_sdk upload_plugin --plugin_zip custom.python.my_oneagent_plugin.zip --server https://my.dynatrace.server/ --token dt0c01....
The server endpoint https://my.dynatrace.server/ is not designed for plugin upload

 

At last : 

plugin_sdk upload_plugin --plugin_zip custom.python.my_oneagent_plugin.zip --server https://my.dynatrace.server/e/<env_id>/api/v1/plugins --token dt0c01....
Attempting to send plugin to server https://my.dynatrace.server/e/<env_id>/api/v1/plugins
plugin has been uploaded successfully

 

If you set it with --server you need to add the correct API endpoint.

Or you can just leave out the --server all together and enter it as mentioned above when prompted, that will select the correct endpoint then.

Dynatrace Certified Master - Dynatrace Partner - 360Performance.net

Not functionning in my case :

plugin_sdk upload_plugin --plugin_zip custom.python.my_oneagent_plugin.zip  --token dt0c01....
File: /etc/init.d/dynatracefunctions not found - Remote Plugin Module is detected
Could not read file /var/lib/dynatrace/oneagent/agent/config/plugin_sdk.conf: No such file or directory - Neither OneAgent nor Remote Plugin Module is detected
server upload endpoint is missing

Looks like plugin_sdk upload_plugin needs the --server parameter.

So for a oneagent plugin  you'd have to use:

plugin_sdk upload_plugin --server https://XXXXXX.live.dynatrace.com/api/v1/plugins  -t dt0c01.XXX.XXX

 

Or you can do it without the --server when building the plugin which would query:

oneagent_build_plugin -t dt0c01.XXX.XXX
...
...
Enter server address, exemplary address: https://demo.dev.dynatracelabs.com, or for managed include the tenant ID in the path: https://latest.managed-dev.dynalabs.io/e/5c6cf54c-5fe3-47e8-af18-54439090370b:

 

 

Dynatrace Certified Master - Dynatrace Partner - 360Performance.net

Featured Posts