MySQL is an open source relational database management system that uses the Structured Query Language to navigate its stores. Netuitive can help monitor the performance and throughput of your MySQL database.
- Open the interface for the database you want to monitor and enter one of the following commands (depending on your needs):
- For normal usage:
If you're having permission issues with the above command, try this one instead:
GRANT ALL PRIVILEGES ON * . * TO '<<username>>'@'<<host>>';
- For innodb engine status:
- For innodb engine status on MySQL versions 5.1.24 and greater:
GRANT PROCESS ON *.* TO '<<username>>'@'<<host>>' IDENTIFIED BY ''<<password>>';
...where <<username>> should be replaced with your MySQL user name, <<host>> should be replaced with your MySQL database's hostname, and <<password>> should be replaced with your MySQL password. Note that some versions of MySQL have issues with localhost being used as your host name, so you may have to use your local IP address instead.Example(s) The below SQL command will grant access to a username of testsql at host 127.0.0.1 with a password of 123pass.
GRANT REPLICATION CLIENT on *.* TO 'testsql'@'127.0.0.1' IDENTIFIED BY '123pass';
- For normal usage:
- Navigate to the MySQLCollector.conf file.
Note The default location is /opt/netuitive-agent/conf/collectors/MySQLCollector.conf.
- Change the enabled setting to True.
- Change the hosts setting to the proper credentials; username is your MySQL user name, password is your MySQL password, 127.0.1.1:3306 is your host name:port number respectively, and mysql is the name of your database that you want to monitor
- Save the file, and restart the Linux Agent.
|enabled||False||Enable collecting MySQL metrics.|
|hosts||username:email@example.com:3306/mysql,||List of hosts to collect from. Use db "None" to avoid connecting to a particular database.
Note The format is username:password@host:port/db[/nickname]
|master||True||Enable collecting SHOW MASTER STATUS.|
|Regex list to match metrics to block. Mutually exclusive with metrics_whitelist option.|
|byte_unit||Default numeric output(s).|
|innodb||Enable collecting SHOW ENGINE INNODB STATUS.|
|measure_collector_time||Measure the collector's run time in milliseconds.|
|metrics_whitelist||Regex list to match metrics to transmit. Mutually exclusive with metrics_blacklist option.|
|publish||Which SHOW GLOBAL STATUS rows you would like to publish, or leave blank to publish all rows.|
|slave||Enable collecting SHOW SLAVE STATUS.|
|Fully Qualified Name (FQN)||Description||Type||Units||Statistic*||Min||Max||Sparse Data Strategy (SDS)||BASE||CORR||UTIL|
|mysql.Bytes_received||The total number of bytes received by the server over the interval.||counter||bytes||0||none||none|
|mysql.Bytes_sent||The total number of bytes sent by the server over the interval.||counter||bytes||0||none||none|
|mysql.Connections||The total number of connection attempts made to the server over the previous interval.||counter||count||0||none||none|
|mysql.Handler_read_*||The total number of times that the query handler read various sections of the indices. These metrics are important for computing the percentage of full table scans.||counter||count||0||none||none|
|mysql.Max_used_connections||The maximum number of connections that have ever been open concurrently since the server was started. This will be a relatively static number.||gauge||count||max||0||none||none|
|mysql.Open_files||The raw data received every minute represents the number of currently open files at that minute. The 5-minute data is the average number of files in an open state during the previous 5 minutes.||gauge||count||average||0||none||none|
|mysql.Open_tables||The raw data received every minute represents the number of currently open tables at that minute. The 5-minute data is the average number of tables in an open state during the previous 5 minutes.||gauge||count||average||0||none||none|
|mysql.Opened_files||The total number of files that were opened during the previous interval. Note that some (or all) of them may have been closed during the interval as well.||counter||count||0||none||none|
|mysql.Opened_tables||The total number of tables that were opened during the previous interval. Note that some (or all) of them may have been closed during the interval as well.||counter||count||0||none||none|
|mysql.Prepared_stmt_count||The raw data received every minute represents the current number of prepared statements at that minute. The 5-minute data is the average number of prepared statements during the previous 5 minutes.||counter||count||0||none||none|
|mysql.Queries||The total number of queries made to the server over the previous interval.||counter||count||0||none||none|
|mysql.Slow_launch_threads||The total number of threads that were slow to launch during the previous interval.||counter||count||0||none||none|
|mysql.Slow_queries||The total number of queries that were slow to execute during the previous interval.||counter||count||0||none||none|
|mysql.Table_locks_immediate||The total number of requested table locks that the server was able to grant immediately during the previous interval.||gauge||count||sum||0||none||none|
|mysql.Table_locks_wait||The total number of requested table locks that the server had to wait before granting during the previous interval.||gauge||count||sum||0||none||none|
|mysql.Threads_cached||The raw data received every minute represents the current number of threads in the thread cache at that minute. The 5-minute data is the average number of threads in the cache during the previous 5 minutes.||counter||count||0||none||none|
|mysql.Threads_connected||The raw data received every minute represents the current number of connections at that minute. The 5-minute data is the average number of connections during the previous 5 minutes.||counter||count||0||none||none|
|mysql.Threads_created||The raw data received is a counter, representing the total number of threads that have been created since the server was last started. The 5-minute data computes the deltas in these values to give the total number of threads created over the past 5 minutes.||counter||count||0||none||none|
|mysql.Threads_running||The raw data received every minute represents the current number of threads which are running at that minute. The 5-minute data is the average number of threads running during the previous 5 minutes.||gauge||count||average||0||none||none|
|Name||Fully Qualified Name (FQN)||Description||Units||Min||Max||BASE||CORR||UTIL||Related Default policies|
|Percentage of Full Table Scans||netuitive.linux.mysql.fulltablescans.percentage||
A full table scan occurs when a query is unable to use an index to assist with its execution, and therefore is required to parse the entire table to find all the rows that satisfy the query. This metric reports the percentage of queries that needed to perform full table scans.
(data['mysql.Handler_read_rnd_next'].actual + data['mysql.Handler_read_rnd'].actual + data['mysql.Handler_read_first'].actual + data['mysql.Handler_read_next'].actual +
|Percentage of Slow Queries||netuitive.linux.mysql.slowqueries.percentage||
Percentage of queries that are running slow.