From dfe02ab0206c78170419bc3263d8673d6170f6fe Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Fri, 28 Nov 2025 12:47:47 +0000 Subject: [PATCH] Adding d/p/27_check_mysql_fix_replica, Fixes reported regression for MariaDB 10.11.14-0+deb12u2 (Closes: #1116027) --- debian/patches/27_check_mysql_fix_replica | 51 +++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 52 insertions(+) create mode 100644 debian/patches/27_check_mysql_fix_replica diff --git a/debian/patches/27_check_mysql_fix_replica b/debian/patches/27_check_mysql_fix_replica new file mode 100644 index 0000000..3cce88f --- /dev/null +++ b/debian/patches/27_check_mysql_fix_replica @@ -0,0 +1,51 @@ +Backport of https://patch-diff.githubusercontent.com/raw/monitoring-plugins/monitoring-plugins/pull/2184.patch + +--- a/plugins/check_mysql.c ++++ b/plugins/check_mysql.c +@@ -300,32 +300,20 @@ + num_fields = mysql_num_fields(res); + fields = mysql_fetch_fields(res); + for(i = 0; i < num_fields; i++) { +- if (use_deprecated_slave_status) { +- if (strcmp(fields[i].name, "Slave_IO_Running") == 0) { +- slave_io_field = i; +- continue; +- } +- if (strcmp(fields[i].name, "Slave_SQL_Running") == 0) { +- slave_sql_field = i; +- continue; +- } +- if (strcmp(fields[i].name, "Seconds_Behind_Master") == 0) { +- seconds_behind_field = i; +- continue; +- } +- } else { +- if (strcmp(fields[i].name, "Replica_IO_Running") == 0) { +- slave_io_field = i; +- continue; +- } +- if (strcmp(fields[i].name, "Replica_SQL_Running") == 0) { +- slave_sql_field = i; +- continue; +- } +- if (strcmp(fields[i].name, "Seconds_Behind_Source") == 0) { +- seconds_behind_field = i; +- continue; +- } ++ if ((strcmp(fields[i].name, "Slave_IO_Running") == 0) || ++ (strcmp(fields[i].name, "Replica_IO_Running") == 0)) { ++ slave_io_field = i; ++ continue; ++ } ++ if ((strcmp(fields[i].name, "Slave_SQL_Running") == 0) || ++ (strcmp(fields[i].name, "Replica_SQL_Running") == 0)) { ++ slave_sql_field = i; ++ continue; ++ } ++ if ((strcmp(fields[i].name, "Seconds_Behind_Master") == 0) || ++ (strcmp(fields[i].name, "Seconds_Behind_Source") == 0)) { ++ seconds_behind_field = i; ++ continue; + } + } + diff --git a/debian/patches/series b/debian/patches/series index f540ae3..d3f523d 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -20,3 +20,4 @@ 25_check_users_sd_get_uids 26_check_mysql_replica # feature patches +27_check_mysql_fix_replica