checkfleet

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 & roleOK with the server version; reports whether the server is read-only.
  • ConnectionsWARN when Threads_connected exceeds conn_warn_pct of max_connections.
  • Replication (only on a replica) — BAD if the IO or SQL thread is not running or the replica is not replicating (Seconds_Behind is NULL); otherwise lag WARN/BAD over lag_warn_seconds/lag_crit_seconds. Works with both the modern SHOW REPLICA STATUS and the legacy SHOW SLAVE STATUS column names.
  • ERROR if 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.