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

needs py3 support for modern collectd #34

Open
jaymzh opened this issue Aug 31, 2021 · 4 comments · May be fixed by #35
Open

needs py3 support for modern collectd #34

jaymzh opened this issue Aug 31, 2021 · 4 comments · May be fixed by #35

Comments

@jaymzh
Copy link

jaymzh commented Aug 31, 2021

Modern versions of collectd's py plugin use python3, and thus this breaks because it's not py3 compatible.

@jaymzh
Copy link
Author

jaymzh commented Aug 31, 2021

Looks like it's just the two print lines at the end without parenthesis!

@jaymzh
Copy link
Author

jaymzh commented Aug 31, 2021

Or not...

Unhandled python exception in read callback: KeyError: 'Innodb_purge_trx_id'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/mysql.py", line 538, in read_callback
    mysql_status = fetch_mysql_status(conn)
  File "/usr/local/lib/python2.7/site-packages/mysql.py", line 353, in fetch_mysql_status
    status['Innodb_unpurged_txns'] = int(status['Innodb_max_trx_id']) - int(status['Innodb_purge_trx_id'])
KeyError: 'Innodb_purge_trx_id'

@jaymzh
Copy link
Author

jaymzh commented Aug 31, 2021

the above can be fixed by changing line 352 from:

if 'Innodb_max_trx_id' in status:

to

if 'Innodb_max_trx_id' in status and 'Innodb_purge_trx_id' in status:

I'll try to get a PR out when I get a moment, but anyone's welcome to just steal all the above and make a PR without crediting me and close this issue. They both fall under obvious fixes.

jaymzh added a commit to jaymzh/collectd-python-mysql that referenced this issue Aug 31, 2021
There's some minor non-py3 compat stuff and a bad index on modern
versions of mysql.

Closes chrisboulton#34

Signed-off-by: Phil Dibowitz <[email protected]>
@jaymzh jaymzh linked a pull request Aug 31, 2021 that will close this issue
@jaymzh
Copy link
Author

jaymzh commented Aug 31, 2021

nevermind. PR attached. :)

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

Successfully merging a pull request may close this issue.

1 participant