Setting up MySQL Statistics in Netdata

MySQL Metrics in Netdata
MySQL Metrics in Netdata

You might noticed MySQL statistics aren’t being show in Netdata. Here’s what I ran into.

Error: “MySQLdb or PyMySQL module is needed to use mysql.chart.py plugin”

The required python libraries for MySQL are missing, so you simply need to install them. For Ubuntu/Debian the following command should correct it.

Shell

Setting up Netdata MySQL User

You might also see these errors in your log.

Plain Text

The fix is simple, add a user called Netdata with a password. Note, you can setup the Netdata user without a password, but this may expose information to the system that you might not want. Full information is located on Netdata’s website.

https://learn.netdata.cloud/docs/agent/collectors/python.d.plugin/mysql

So let’s get Netdata pulling MySQL data.

Fast, open and potentially insecure no password optiom

This will just work, but leave a user on your MySQL instance without a password.

Plain Text

Password based polling

Let’s run the same command as above but give the user a password.

Plain Text

Now we need to tell Netdata the password.

Plain Text

Instead of editing the defaults, go to the bottom of the config and just create a new section with the following

Plain Text

Now you should see MySQL metrics in Netdata

View of MySQL Metrics in Netdata

Did you like this article?


0 Shares:
You May Also Like

Hard times for hard drives: US may ban popular imports

This could be a damaging blow to quite a few companies within the United States. For instance, take a dedicated server hosting company that relies on one of many hardware vendors like Dell or HP (Hewlett-Packard). Its possible that said vendor will have stock pile of hard drives. Put lets put this into perspective. If you read the entire article you will see a similar situation that ended with Broadcom filing a complaint against Qualcomm. The International Trade Commission banned Qualcomm from shipping any new chips and hardware into the United Sates, and any chips that were already being shipped to the United States could continue. The ban lasted for 45 days, until an appeal by Qualcomm was successful and then the ban was lifted.
Read More