Code Monkey home page Code Monkey logo

Comments (5)

chuckpu avatar chuckpu commented on August 11, 2024

I got this error too.
Did U solved it

from gmond_python_modules.

alpha01 avatar alpha01 commented on August 11, 2024

Have you guys tried renaming the module to ensure it's not conflicting with Python's own mysql module?

from gmond_python_modules.

chuckpu avatar chuckpu commented on August 11, 2024

I have tried to rename it to mysql_test but got the error either
[root@localhost python_modules]# /usr/local/ganglia/sbin/gmond -d10
loaded module: core_metrics
loaded module: cpu_module
loaded module: disk_module
loaded module: load_module
loaded module: mem_module
loaded module: net_module
loaded module: proc_module
loaded module: sys_module
loaded module: python_module
[PYTHON] Can't call the metric_init function in the python module [mysql_test].

Traceback (most recent call last):
File "/usr/local/lib64/ganglia/python_modules/mysql_test.py", line 1095, in metric_init
update_stats(REPORT_INNODB, REPORT_MASTER, REPORT_SLAVE)
File "/usr/local/lib64/ganglia/python_modules/mysql_test.py", line 264, in update_stats
mysql_stats[key] = (int(global_status[key]) - int(mysql_stats_last[key])) / time_delta
ValueError: invalid literal for int() with base 10: ''
udp_recv_channel mcast_join=NULL mcast_if=NULL port=8649 bind=NULL buffer=0
socket created, SO_RCVBUF = 124928

tcp_accept_channel bind=NULL port=8649 gzip_output=0
Unable to create tcp_accept_channel. Exiting.

from gmond_python_modules.

chuckpu avatar chuckpu commented on August 11, 2024
if global_status[key]=='':
   a = '0'
else:
   a = global_status[key]
if mysql_stats_last[key] == '':
   b = '0'
else:
  b = mysql_stats_last[key]
  mysql_stats[key] = (int(a) - int(b)) / time_delta

I changed mysql.py to this , it works well

from gmond_python_modules.

vvuksan avatar vvuksan commented on August 11, 2024

@chuckpu can you submit a pull request ?

Thanks

from gmond_python_modules.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.