Check mysql-replica-status


Checks the replication status of MySQL/MariaDB. Logic is taken from MySQLTuner script, v1.9.8.


  • On RHEL 7+, one way to install the Python MySQL Connector is via pip install pymysql

  • Can also be run against standalone servers.

  • Compared to check_mysql / MySQLTuner this check currently:

    • supports only simple login with username/password (not via SSL/TLS)

    • does not support a connection via socket

Fact Sheet

Check Plugin Download

Check Interval Recommendation

Once a minute

Can be called without parameters


Available for

Python 3, Windows


Python module pymysql; User with SUPER, REPLICATION CLIENT and REPLICATION SLAVE privileges, locked down to - for example monitoring@ Usernames in MySQL/MariaDB are limited to 16 chars in specific versions.


usage: mysql-replica-status [-h] [-V] [--always-ok] [-H HOSTNAME]
                            [-p PASSWORD] [--port PORT]
                            [--severity {warn,crit}] [-u USERNAME]

Checks the replication status of MySQL/MariaDB.

  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  --always-ok           Always returns OK.
  -H HOSTNAME, --hostname HOSTNAME
                        MySQL/MariaDB hostname. Default:
  -p PASSWORD, --password PASSWORD
                        Use the indicated password to authenticate the
                        connection. Default:
  --port PORT           MySQL/MariaDB port. Default: 3306
  --severity {warn,crit}
                        Severity for alerts that do not depend on thresholds.
                        One of "warn" or "crit". Default: warn
  -u USERNAME, --username USERNAME
                        MySQL/MariaDB username. Default: root

Usage Examples

./mysql-replica-status --hostname localhost --username root --password mypassword


Galera Synchronous replication: NO. Binlog format: ROW, XA support enabled: ON. Semi synchronous Primary: Not Activated. Semi synchronous Replica: Not Activated. This Replica is not running but seems to be configured [WARNING].


Alert with the given severity, if the replica (aka slave)…

  • is not running but seems to be configured

  • is running with the read_only option disabled

  • is lagging behind Primary

Perfdata / Metrics

There is no perfdata.

Credits, License