New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Netdata not working with MySQL because SHOW USER STATISTICS MariaDB only command #7518
Comments
Hi @werowe
I think it works, and it works on your install - i see If some query doesnt work, module excludes it from list of queries. |
I used MariaDB instead. That query is part of the install script. It should recognize that the installation is MySQL and skip the SHOW USER STATISTICS command. But it doesn’t, so you can’t start MySQL job. It looks like a bug to me. Of course that’s not logical since users as obviously using MySQL. But as of last week on Ubuntu 18.04 and the latest version of MySQL that’s the error I got. You can run the module in debug more or look at /var/log/errors.log and see it say Invalid SQL syntax. |
Yes, it should remove that query if it raises an error. netdata/collectors/python.d.plugin/python_modules/bases/FrameworkServices/MySQLService.py Lines 142 to 150 in 757ce94
Of it response is empty netdata/collectors/python.d.plugin/mysql/mysql.chart.py Lines 822 to 826 in bfae683
Could you do as
|
I purged MariDB and installed MySQL 5.7. Results. Not sure. Debug log looks good, but item not added to dashboard. Seems error only occurs when you use Python pymysql and not
Debug log started to show output but item not added to dashboard. Might not be added to dashboard because it might think that dashboard item successfully added in first try with first Python client. Moved web interface to http://walkercodetutorials.com:19999/ . MySQL not showing up on console and errors in log. Yet, when installed 2nd Python library mysqlclient after first starting with pymysql
started to both throw errors but got a match on mysql[debiancnf] and then it started echoing stats, thus it was working. And it looked like it successfully removed the query:
Started with this andcorresponding output https://pastebin.com/Bw0FdUna
Then added this and corresponding output: https://pastebin.com/BKDxwJJi
All of these errors disappeared from the log when I added the other, i.e., second, Python lib mysqlclient instead of using pymysql
|
Yes, it works, the
Keep in mind you need to execute |
Thanks. I am your tech writer. I am going to update the documentation with a note to say don't use the PyMySql driver. Use mysqlclient instead. The first one does not through an error that python.d.plugin catches. |
What errors are you talking about? I think module works both with i think netdata/collectors/python.d.plugin/python_modules/bases/FrameworkServices/MySQLService.py Lines 53 to 58 in fc0570f
I think there is no problem atm and we need just to remove the check. So, please, if you have time, do one more test with delete these lines netdata/collectors/python.d.plugin/python_modules/bases/FrameworkServices/MySQLService.py Lines 54 to 57 in fc0570f
and restart netdata.service |
The error with PyMySQL looks like this. I will repeat the exercise in a could of days to prove it.
|
ilyam8 do you work for Netdata? Perhaps you can try on your server. I am trying these commands to purge my installation but cannot get beyond this error:
Here are the instructions I followed to purge mariadb and mysql and reinstall, plus sudo pip install pymysql:
|
What distro are you on? |
Distro of what? Ubuntu 18.04 and whatever Netdats is the current one you get with Curl. |
Yes, i meant that, thanks. If i understood you right, to reproduce your problem i need:
I see the problem is not severe. I will check it later. I think all we need to do is to remove netdata/collectors/python.d.plugin/python_modules/bases/FrameworkServices/MySQLService.py Lines 54 to 57 in fc0570f
|
Netdata is not working with MySQL, only MariaDB. This is because this command SHOW USER_STATISTICS in this file only works in MariaDB.
Problem code is https://github.com/netdata/netdata/blob/bfae683664b488df91940a81760459db2b18983c/collectors/python.d.plugin/mysql/mysql.chart.py
My install is http://walkercodetutorials.codes:19999
The text was updated successfully, but these errors were encountered: