Skip to content

Fix py3 and bad index #35

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def fetch_mysql_status(conn):
status[row['Variable_name']] = row['Value']

# calculate the number of unpurged txns from existing variables
if 'Innodb_max_trx_id' in status:
if 'Innodb_max_trx_id' in status and 'Innodb_purge_trx_id' in status:
status['Innodb_unpurged_txns'] = int(status['Innodb_max_trx_id']) - int(status['Innodb_purge_trx_id'])

if 'Innodb_lsn_last_checkpoint' in status:
Expand Down Expand Up @@ -582,8 +582,8 @@ def read_callback():
collectd.register_config(configure_callback)

if __name__ == "__main__" and not COLLECTD_ENABLED:
print "Running in test mode, invoke with"
print sys.argv[0] + " Host Port User Password "
print("Running in test mode, invoke with")
print(sys.argv[0] + " Host Port User Password ")
MYSQL_CONFIG['Host'] = sys.argv[1]
MYSQL_CONFIG['Port'] = int(sys.argv[2])
MYSQL_CONFIG['User'] = sys.argv[3]
Expand Down