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

OneAgent extension - request for configuration elements

PierreLamonzie
Visitor

Hello all,

We are using a custom OneAgent extension that displays certain fields for its own configuration.

We have thousands of hosts having this extension used and configured.

(On premise Dynatrace)

I am wondering how to get all those configuration elements by API ? To get a result like field name:field value for each host in a json.

Thx and regards.

Pierre

2 REPLIES 2

Hi @PierreLamonzie 


you can get each host extension data using extension API (example below)
Then You can do a script to iterate on step 5 and trigger step 6 for each result from step5

 

1 - Generate token with - read config 
2 - go to configuration API and authorize
3 - Find "/extension" and list all avaiable extension:
  /api/config/v1/extensions?pageSize=200

4 - copy id of you extension for example:
  custom.python.cert_plugin
5 - use id as parameter for "extensions/{id}/instances"
  /api/config/v1/extensions/custom.python.cert_plugin/instances?pageSize=200
  you will get list of custom configured instances:

  {
     "configurationsList": [
    {
      "id": "HOST-4544E85D1B018C76"
    }
    ],
    "totalResults": 1
  }
6 - now go to "extensions/{id}/instances/{configurationId}"
  fill id and configurationID:
  /api/config/v1/extensions/custom.python.cert_plugin/instances/HOST-4544E85D1B018C76'
  in response you will get configuration of plugin in specific host:
  {
  "extensionId": "custom.python.cert_plugin",
  "enabled": true,
  "useGlobal": false,
  "properties": {
    "CertList": "",
    "ExpDays": "366",
    "Split": ";",
    "LogFileLocation": "C:\\ProgramData\\dynatrace\\oneagent\\log\\plugin\\",
    "DebugLevel": "INFO"
  },
  "hostId": "HOST-4544E85D1B018C76"
  }

Hope it helps

Bests
Michal

Thanks a lot Michal, it works perfectly !

Featured Posts