Mysql master is recognized as mysql slave


one of our mysql master servers (mysql-community-server-5.7) outputs a mysql_slave section:

*************************** 1. row ***************************
             Slave_IO_Running: No
            Slave_SQL_Running: No
        Seconds_Behind_Master: NULL

But our DBAs say it’s the master and not the slave and they think checkmk is failing here.

I am not sure what to do about it.

Even if I do a "cmk -IIv " it again discovers a “MySQL DB Slave mysql” Service.

Your DBAs sometimes swap roles of the mysql server, e.g. server1 is master and server2 is slave they change it to server1 becomes slave and server2 becomes master.
I am not sure if that is related to the problem.

The mk_mysql plugin on the mysqlserver outputs in any case a mysql_slave section
with the output of “show slave status”, so I assume the checkmk check mysql_slave is failing to recognize that this is not a slave but a master.

But in /opt/omd/versions/2.0.0p22.cee/share/check_mk/checks/mysql_slave i can not see
any code that it is trying to detect if it’s master or a slave.

Is the problem that “show slave status” does give output even it’s a master ?
Are (virgin) mysql masters are usually not doing any output for “show slave status” ?

Any hints are very welcome!

CMK version: 2.0.0p22 CEE
OS version: CentOS 7.9.2009


The output of show slave status needs to be blank, like this.

mysql> show slave status;
Empty set (0.00 sec)

After promoting a DB to become master, your DBAs need to run a reset slave on it.


Thanks a lot Richard, this was exactly the missing piece!

In this case a reset slave was not sufficent, but a reset slave all did the job.

 reset slave all
1 Like