MySQL / MariaDB check
mysql — MySQL / MariaDB
Reachability, read-only role, connection saturation, replica IO/SQL threads and lag.
checkfleet check mysql --config checkfleet.yml
Read-only health check via the standard go-sql-driver/mysql (a motivated
exception to the zero-dep rule, like pgx for Postgres):
- Reachable & role —
OKwith the server version; reports whether the server is read-only. - Connections —
WARNwhenThreads_connectedexceedsconn_warn_pctofmax_connections. - Replication (only on a replica) —
BADif the IO or SQL thread is not running or the replica is not replicating (Seconds_Behindis NULL); otherwise lagWARN/BADoverlag_warn_seconds/lag_crit_seconds. Works with both the modernSHOW REPLICA STATUSand the legacySHOW SLAVE STATUScolumn names. ERRORif the server is unreachable or a query fails.
Put the password in the DSN via ${ENV} interpolation — it is resolved from the
environment at config load, never stored inline. The finding logic is unit-tested
with a fake collector; no real database in tests.
mysql:
lag_warn_seconds: 10
lag_crit_seconds: 60
targets:
- {name: primary, dsn: "monitor:${MYSQL_PASSWORD}@tcp(db-01:3306)/"}
See the full module reference for every check, or configuration for the config keys.