summaryrefslogtreecommitdiffstats
path: root/plugins/check_mysql.c
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-09-26 09:07:18 +0200
committerLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-09-26 09:07:18 +0200
commitdbe417bdf9d4af8b6c07b9f04579a38231b783ed (patch)
tree9ce89ea23b814b5395c75fd5bd925ca41fc628f1 /plugins/check_mysql.c
parenta51ff78f83c822f0a809ee3dbb6a1856b1fcc589 (diff)
downloadmonitoring-plugins-dbe417bdf9d4af8b6c07b9f04579a38231b783ed.tar.gz
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.
Diffstat (limited to 'plugins/check_mysql.c')
-rw-r--r--plugins/check_mysql.c7
1 files 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) {
219 use_deprecated_slave_status = true; 219 use_deprecated_slave_status = true;
220 } 220 }
221 } 221 }
222 } else if (strstr(server_version, "MySQL") != NULL) { 222 } else {
223 // Looks like MySQL 223 // Looks like MySQL or at least not like MariaDB
224 if (major_version < 8) { 224 if (major_version < 8) {
225 use_deprecated_slave_status = true; 225 use_deprecated_slave_status = true;
226 } else if (major_version == 10 && minor_version < 4) { 226 } else if (major_version == 10 && minor_version < 4) {
227 use_deprecated_slave_status = true; 227 use_deprecated_slave_status = true;
228 } 228 }
229 } else {
230 printf("Not a known sever implementation: %s\n", server_version);
231 exit(STATE_UNKNOWN);
232 } 229 }
233 230
234 char *replica_query = NULL; 231 char *replica_query = NULL;