Guys, please, I need some help on an extension. I need to create a plugin that executes a query against a MySQL database. Should I create an ActiveGate Extension or Oneagent extension? Does anyone have an example or any documentation that shows a model?
Solved! Go to Solution.
The answer is - it depends on the requirements. If it's for a single purpose, I'd consider writing a simple script that will execute queries using MySQL command line client and push the metrics using metric ingestion or events using API. This is much simpler than the writing extension.
If you still need to create an extension, keep in mind:
For samples see here in the docs and for inspiration, you can look into the code of the MySQL extension that is shipped with the OneAgent itself.
Julius, sorry, but just a question. To run the first option you mentioned, I would need the agent installed on the database servers, right? My question is how I would schedule this script execution and sending the metrics, which makes me wonder.
@RodrigoBiaggio you have actually two options here for sending.
Depending on your DB you can execute it remotely.
Regarding scheduling - use cron or systemd on Linux for example, Windows scheduler on windows. It's really up to you. You can also run a daemon in and process it in a loop.
How are database credentials stored and maintained with this plugin?
As with any custom extension that implements the Extensions SDK the instance config (including DB credentials in this case) can be managed either via the UI (via "endpoint config" in the custom extension settings) or programmatically via the config API (via GET/PUT/DELETE /api/config/v1/extensions/{id}/instances/{configurationId}).
They are stored encrypted in the Dynatrace database. It is then transferred in a secure way to the ActiveGate and never leave the ActiveGate’s memory.