Module: monitoring-plugins
 Branch: maintenance-2.4.0-check_mysql
 Commit: 291a704bcf738f6ceb7a1f46c69b8332b33dbd70
 Author: Lorenz Kästle <[email protected]>
   Date: Fri Sep 26 08:57:19 2025 +0200
    URL: 
https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=291a704b

check_mysql: Assume MySQL server by default (in replica check)

In the Debian Bug tracker (and then Github) a person pointed out,
that a MySQL server does not respond with a hint that is indeed the
MySQL software, but only with the version string.
Which makes sense if one assumes to be the only implementation.

This commit changes the behaviour of the Replica check to assume
that the counterpart is a MySQL server if there are not hints that
it is a MariaDB server.

---

 plugins/check_mysql.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index 1b7403f7..951a96f9 100644
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
@@ -239,16 +239,13 @@ main (int argc, char **argv)
                                        use_deprecated_slave_status = true;
                                }
                        }
-               } else if (strstr(server_version, "MySQL") != NULL) {
-                       // Looks like MySQL
+               } else {
+                       // Looks like MySQL (or at least not like MariaDB)
                        if (major_version < 8) {
                                use_deprecated_slave_status = true;
                        } else if (major_version == 10 && minor_version < 4) {
                                use_deprecated_slave_status = true;
                        }
-               } else {
-                       printf("Not a known sever implementation: %s\n", 
server_version);
-                       exit(STATE_UNKNOWN);
                }
 
                char *replica_query = NULL;

Reply via email to