Module: monitoring-plugins
 Branch: master
 Commit: dbe417bdf9d4af8b6c07b9f04579a38231b783ed
 Author: Lorenz Kästle <[email protected]>
   Date: Fri Sep 26 09:07:18 2025 +0200
    URL: 
https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=dbe417bd

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 3d7ec4cd..062ec657 100644
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
@@ -219,16 +219,13 @@ int 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