0

I currently add some metrics to ganglia python plugin which monitor MySQL status.

It has been working for a long time. after modifying the mysql.py, I restart gmond, and log shows

[PYTHON] Can't import the metric module [mysql].

I run gmond -m and get the result:

[PYTHON] Can't import the metric module [mysql].

Traceback (most recent call last):
  File "/usr/lib/ganglia/python_modules/mysql.py", line 49, in <module>
  import MySQLdb
ImportError: No module named MySQLdb

I can import MySQLdb in python cli, what's the problem?

enzoyang
  • 847
  • 4
  • 13
  • 25
  • Long shot, but is Ganglia using the same Python executable as you do on the terminal? I would put in this mysql.py a line 'print sys.executable'. – geertjanvdk Feb 10 '14 at 13:21
  • I finally know the cause, my system upgrade from ubuntu 11.04 to 12.04, ganglia was using old python2.6 while MySQLdb was installed in python2.7 – enzoyang Feb 11 '14 at 15:58

1 Answers1

0

My system upgrade from ubuntu 11.04 to 12.04, ganglia was using old python2.6 while MySQLdb was installed in python2.7.

I reinstall ganglia-monitor and the problem is solved.

enzoyang
  • 847
  • 4
  • 13
  • 25