14 Nov 2022 03:54 PM - last edited on 15 Nov 2022 08:53 AM by MaciejNeumann
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 :
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.
Solved! Go to Solution.
14 Nov 2022 04:13 PM
BTW, plugin_sdk upload_plugin tell me
Please execute oneagent_verify_plugin before upload to validate plugin.json against the schema
which
14 Nov 2022 04:36 PM
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.
15 Nov 2022 10:15 AM - edited 15 Nov 2022 10:18 AM
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.
15 Nov 2022 12:57 PM
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
15 Nov 2022 01:01 PM
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.
15 Nov 2022 01:06 PM
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
15 Nov 2022 03:50 PM
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: