Check mysql-perf-metrics¶
Overview¶
Checks performance-related best practice configurations for MySQL/MariaDB, including whether InnoDB stats are updated during INFORMATION_SCHEMA queries, concurrent inserts are enabled, and InnoDB file-per-table is activated.
Important Notes:
Requires MySQL/MariaDB v5.5+
Data Collection:
Queries
SHOW GLOBAL VARIABLESforconcurrent_insert,innodb_file_per_table, andinnodb_stats_on_metadataChecks the InnoDB storage engine availability
Logic is taken from MySQLTuner script:check_metadata_perf(), v1.9.8
Fact Sheet¶
Fact |
Value |
|---|---|
Check Plugin Download |
https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/mysql-perf-metrics |
Nagios/Icinga Check Name |
|
Check Interval Recommendation |
Every day |
Can be called without parameters |
Yes |
Runs on |
Cross-platform |
Compiled for Windows |
No |
3rd Party Python modules |
|
Help¶
usage: mysql-perf-metrics [-h] [-V] [--always-ok]
[--defaults-file DEFAULTS_FILE]
[--defaults-group DEFAULTS_GROUP]
[--timeout TIMEOUT]
Checks performance metrics and best practice configurations for MySQL/MariaDB,
including query cache efficiency, key buffer usage, and other tuning
indicators. Alerts on suboptimal configurations.
options:
-h, --help show this help message and exit
-V, --version show program's version number and exit
--always-ok Always returns OK.
--defaults-file DEFAULTS_FILE
MySQL/MariaDB cnf file to read user, host and password
from. Example: `--defaults-
file=/var/spool/icinga2/.my.cnf`. Default:
/var/spool/icinga2/.my.cnf
--defaults-group DEFAULTS_GROUP
Group/section to read from in the cnf file. Default:
client
--timeout TIMEOUT Network timeout in seconds. Default: 3 (seconds)
Usage Examples¶
./mysql-perf-metrics --defaults-file=/var/spool/icinga2/.my.cnf
Output:
Stat are updated during querying INFORMATION_SCHEMA [WARNING]. Set innodb_stats_on_metadata to OFF. Concurrent INSERTs are off [WARNING]. Set concurrent_insert to AUTO or ALWAYS. InnoDB File per table is not activated [WARNING]. Set innodb_file_per_table to ON.
States¶
WARN if
concurrent_insertis not set to AUTO or ALWAYS.WARN if
innodb_file_per_tableis not set to ON (when InnoDB is enabled).WARN if
innodb_stats_on_metadatais not set to OFF.--always-oksuppresses all alerts and always returns OK.
Perfdata / Metrics¶
There is no perfdata.
Credits, License¶
Authors: Linuxfabrik GmbH, Zurich
License: The Unlicense, see LICENSE file.
Credits:
heavily inspired by MySQLTuner (https://github.com/major/MySQLTuner-perl)