MySQL monitoring with Netdata
Monitors one or more MySQL servers.
#
Requirements- python library MySQLdb (faster) or PyMySQL (slower)
netdata
local user to connect to the MySQL server.
To create the netdata
user, execute the following in the MySQL shell:
The netdata
user will have the ability to connect to the MySQL server on localhost
without a password.
It will only be able to gather MySQL statistics without being able to alter or affect MySQL operations in any way.
This module will produce following charts (if data is available):
Bandwidth in kilobits/s
- in
- out
Queries in queries/sec
- queries
- questions
- slow queries
Queries By Type in queries/s
- select
- delete
- update
- insert
- cache hits
- replace
Handlers in handlers/s
- commit
- delete
- prepare
- read first
- read key
- read next
- read prev
- read rnd
- read rnd next
- rollback
- savepoint
- savepoint rollback
- update
- write
Table Locks in locks/s
- immediate
- waited
Table Select Join Issues in joins/s
- full join
- full range join
- range
- range check
- scan
Table Sort Issues in joins/s
- merge passes
- range
- scan
Tmp Operations in created/s
- disk tables
- files
- tables
Connections in connections/s
- all
- aborted
Connections Active in connections/s
- active
- limit
- max active
Binlog Cache in threads
- disk
- all
Threads in transactions/s
- connected
- cached
- running
Threads Creation Rate in threads/s
- created
Threads Cache Misses in misses
- misses
InnoDB I/O Bandwidth in KiB/s
- read
- write
InnoDB I/O Operations in operations/s
- reads
- writes
- fsyncs
InnoDB Pending I/O Operations in operations/s
- reads
- writes
- fsyncs
InnoDB Log Operations in operations/s
- waits
- write requests
- writes
InnoDB OS Log Pending Operations in operations
- fsyncs
- writes
InnoDB OS Log Operations in operations/s
- fsyncs
InnoDB OS Log Bandwidth in KiB/s
- write
InnoDB Current Row Locks in operations
- current waits
InnoDB Row Operations in operations/s
- inserted
- read
- updated
- deleted
InnoDB Buffer Pool Pages in pages
- data
- dirty
- free
- misc
- total
InnoDB Buffer Pool Flush Pages Requests in requests/s
- flush pages
InnoDB Buffer Pool Bytes in MiB
- data
- dirty
InnoDB Buffer Pool Operations in operations/s
- disk reads
- wait free
QCache Operations in queries/s
- hits
- lowmem prunes
- inserts
- no caches
QCache Queries in Cache in queries
- queries
QCache Free Memory in MiB
- free
QCache Memory Blocks in blocks
- free
- total
MyISAM Key Cache Blocks in blocks
- unused
- used
- not flushed
MyISAM Key Cache Requests in requests/s
- reads
- writes
MyISAM Key Cache Requests in requests/s
- reads
- writes
MyISAM Key Cache Disk Operations in operations/s
- reads
- writes
Open Files in files
- files
Opened Files Rate in files/s
- files
Binlog Statement Cache in statements/s
- disk
- all
Connection Errors in errors/s
- accept
- internal
- max
- peer addr
- select
- tcpwrap
Slave Behind Seconds in seconds
- time
I/O / SQL Thread Running State in bool
- sql
- io
Galera Replicated Writesets in writesets/s
- rx
- tx
Galera Replicated Bytes in KiB/s
- rx
- tx
Galera Queue in writesets
- rx
- tx
Galera Replication Conflicts in transactions
- bf aborts
- cert fails
Galera Flow Control in ms
- paused
Galera Cluster Status in status
- status
Galera Cluster State in state
- state
Galera Number of Nodes in the Cluster in num
- nodes
Galera Total Weight of the Current Members in the Cluster in weight
- weight
Galera Whether the Node is Connected to the Cluster in boolean
- connected
Galera Whether the Node is Ready to Accept Queries in boolean
- ready
Galera Open Transactions in num
- open transactions
Galera Total Number of WSRep (applier/rollbacker) Threads in num
- threads
Users CPU time in percentage
- users
Per user statistics:
Rows Operations in operations/s
- read
- send
- updated
- inserted
- deleted
Commands in commands/s
- select
- update
- other
#
ConfigurationEdit the python.d/mysql.conf
configuration file using edit-config
from the Netdata config
directory, which is typically at /etc/netdata
.
You can provide, per server, the following:
username which have access to database (defaults to 'root')
password (defaults to none)
mysql my.cnf configuration file
mysql socket (optional)
mysql host (ip or hostname)
mysql port (defaults to 3306)
ssl connection parameters
- key: the path name of the client private key file.
- cert: the path name of the client public key certificate file.
- ca: the path name of the Certificate Authority (CA) certificate file. This option, if used, must specify the same certificate used by the server.
- capath: the path name of the directory that contains trusted SSL CA certificate files.
- cipher: the list of permitted ciphers for SSL encryption.
Here is an example for 3 servers:
If no configuration is given, the module will attempt to connect to MySQL server via a unix socket at
/var/run/mysqld/mysqld.sock
without password and with username root
or netdata
(you granted permissions for netdata
user in the Requirements section of this document).
userstats
graph works only if you enable the plugin in MariaDB server and set proper MySQL privileges (SUPER or
PROCESS). For more details, please check the MariaDB User Statistics
page