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.
@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.