Skip to content
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

Mysqld module errors #163

Open
cyberflow opened this issue Sep 17, 2014 · 5 comments
Open

Mysqld module errors #163

cyberflow opened this issue Sep 17, 2014 · 5 comments

Comments

@cyberflow
Copy link

If i try add module to ganglia i get error in logs:

/usr/sbin/gmond[3861]: [PYTHON] Can't call the metric_init function in the python module [mysql].#012

if i try run module form console:

# python /usr/lib/ganglia/python_modules/mysql.py -u root -p password --no-master --no-slave
Traceback (most recent call last):
  File "/usr/lib/ganglia/python_modules/mysql.py", line 1160, in <module>
    'unix_socket': options.unix_socket,
  File "/usr/lib/ganglia/python_modules/mysql.py", line 1095, in metric_init
    update_stats(REPORT_INNODB, REPORT_MASTER, REPORT_SLAVE)
  File "/usr/lib/ganglia/python_modules/mysql.py", line 266, in update_stats
    mysql_stats[key] = int(global_status[key]) - int(mysql_stats_last[key])
ValueError: invalid literal for int() with base 10: ''
@chuckpu
Copy link

chuckpu commented Sep 30, 2014

I got this error too.
Did U solved it

@alpha01
Copy link

alpha01 commented Oct 2, 2014

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

@chuckpu
Copy link

chuckpu commented Oct 3, 2014

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.

@chuckpu
Copy link

chuckpu commented Oct 4, 2014

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

@vvuksan
Copy link
Member

vvuksan commented Jan 26, 2015

@chuckpu can you submit a pull request ?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants