Ever wanted to extend MySQL and add some feature you think it is missing? With MySQL plugins, you can do exactly that. One thing that has bothered me for several years is that you cannot easily retrieve system metrics from within MySQL. Whether I am connecting via a remote connection or looking to add features to monitoring without the need for another interface with the server, I have wanted to retrieve system metrics without leaving the MySQL interface.
So, I started a Proof of Concept for this. My goal was to get metrics such as RAM (total, used, free), system load, CPU utilization, disk utilization for the file system containing the datadir, and more. My objective was to do this as efficiently within MySQL as possible. For this, I chose to utilize standard C libraries in as few lines of code as possible without having to scrape system files or run commands to get the data. The …
[Read more]