Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ You should then configure the MySQL plugin:
Port 3306 (default: 3306)
User "root" (default: root)
Password "xxxx" (default: empty)
Socket "/var/lib/mysql/mysql.sock" (default: /var/lib/mysql/mysql.sock)
HeartbeatTable "percona.heartbeat" (if using pt-heartbeat to track slave lag)
Verbose false (default: false)
</Module>
</Python>
</Plugin>

## Metrics

Expand Down Expand Up @@ -323,4 +324,4 @@ For versions of MySQL with support for it and where enabled, `INFORMATION_SCHEMA
response_time_count.14

## License
MIT (http://www.opensource.org/licenses/mit-license.php)
MIT (http://www.opensource.org/licenses/mit-license.php)
4 changes: 3 additions & 1 deletion mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'Password': '',
'HeartbeatTable': '',
'Verbose': False,
'Socket': '/var/lib/mysql/mysql.sock'
}

MYSQL_STATUS_VARS = {
Expand Down Expand Up @@ -289,7 +290,8 @@ def get_mysql_conn():
host=MYSQL_CONFIG['Host'],
port=MYSQL_CONFIG['Port'],
user=MYSQL_CONFIG['User'],
passwd=MYSQL_CONFIG['Password']
passwd=MYSQL_CONFIG['Password'],
unix_socket=MYSQL_CONFIG['Socket']
)

def mysql_query(conn, query):
Expand Down