]> arthur.barton.de Git - netdata.git/blobdiff - python.d/mysql.chart.py
Merge branch 'objects'
[netdata.git] / python.d / mysql.chart.py
index 793b6aec4535e596f9b618a399217ba028d14bb1..04ccd4c4637be4b0f530d46d78e3d995fad43488 100644 (file)
@@ -4,8 +4,6 @@
 NAME = "mysql.chart.py"
 import sys
 
-sys.path.append("./python_modules") #FIXME it is here for debug only
-
 # import 3rd party library to handle MySQL communication
 try:
     import MySQLdb
@@ -17,7 +15,8 @@ except ImportError:
         # https://github.com/PyMySQL/PyMySQL
         sys.stderr.write(NAME + ": using pymysql\n")
     except ImportError:
-        sys.stderr.write(NAME + ": You need to install PyMySQL module to use mysql.chart.py plugin\n")
+        sys.stderr.write(NAME + ": You need to install MySQLdb or PyMySQL module to use mysql.chart.py plugin\n")
+        raise ImportError
 
 from base import BaseService
 
@@ -26,7 +25,7 @@ from base import BaseService
 config = {
     'local': {
         'user'     : 'root',
-        'password' : 'a',
+        'password' : '',
         'socket'   : '/var/run/mysqld/mysqld.sock',
         'update_every' : 3,
         'retries'  : 4,
@@ -452,10 +451,3 @@ class Service(BaseService):
                 print(header + lines + "END")
         
         return True
-
-#FIXME debug only:
-if __name__ == "__main__":
-    my = Service(config['local'],'loc')
-    my.check()
-    my.create()
-    my.update(1)