Skip to content

Conversation

@RincewindsHat
Copy link
Member

fixes #2060

This patchset contains two parts.

  • Replaces 'slave' (almost) everywhere with 'replica' since this seems to be the future naming
    convention for MySQL (and MariaDB too).
    Another cli option --check-replica gets introduced and check_slave marked as deprecated
    (although it will still work for now)
  • Modifies the replica query in a way where it queries the server version first and depending
    on the result queries for replicas or for "slaves" if the version is older and does not
    provide that syntax

This commit adds an option "check-replica" to check_mysql which
replaces "check-slave" (which still works).
The changes are introduced to follow the naming scheme of
MySQL/MariaDB, since this was changed there in version 8 (MySQL) or
10.5.1 (MariaDB).
@RincewindsHat RincewindsHat force-pushed the check_mysql_replica_check branch from 8c97da5 to c08e2bc Compare February 24, 2025 19:28
@RincewindsHat
Copy link
Member Author

@seb4web This should fix your problem.

@RincewindsHat RincewindsHat merged commit 9e1c72a into monitoring-plugins:master Mar 7, 2025
7 checks passed
@waja waja added this to the 2.4.1 milestone Mar 7, 2025
@abaddononion
Copy link

abaddononion commented Jul 23, 2025

I'm trying to figure out how to get ahold of this patch... we're attempting to run MySQL 8.4 on an Alma 9 server and encountering this issue. Has there been a release containing this patch yet? I could also build my own nagios-plugins RPMs from scratch if I need... but I wasn't sure how to make sure I'm pulling in this changeset. Any advice?

EDIT: I tried building from the 2.4.12 src.rpm, but it doesn't appear to contain this patch either. I tried to patch it in myself by hand, but it seems to depend on some sort of a deeper reorg involving files like threshold.h and perfdata.h.

@RincewindsHat
Copy link
Member Author

Hi @abaddononion,
first things first: This project contains the "Monitoring Plugins" of which "nagios-plugins" is a fork. RHEL ships "nagios-plugins", debianish OSes and SLES "monitoring-plugins".

Currently it might be difficult to cherry-pick this patch, since I am refactoring a lot of stuff and there are a lot of intermixed changes. You could use the master branch which should work in theory but it is not release ready and I am not sure whether I can recommend to run it in production.

@abaddononion
Copy link

Hi @abaddononion, first things first: This project contains the "Monitoring Plugins" of which "nagios-plugins" is a fork. RHEL ships "nagios-plugins", debianish OSes and SLES "monitoring-plugins".

Currently it might be difficult to cherry-pick this patch, since I am refactoring a lot of stuff and there are a lot of intermixed changes. You could use the master branch which should work in theory but it is not release ready and I am not sure whether I can recommend to run it in production.

I see. so even if you release a new "Monitoring Plugins" package, that won't help me until the fork catches up... well that's problematic, for sure.

I guess I'm going to have to write my own patch for the nagios-plugins package in the meantime and just go off-grid, because otherwise it seems like this is going to be a long wait, and I'm supposed to go to production with MySQL 8.4 in about a month.

Thanks for the feedback.

@waja
Copy link
Member

waja commented Sep 23, 2025

@RincewindsHat This isses has landed into the Debian BTS: https://bugs.debian.org/1116027

As I would love to fix it in Debian stable, as it might be EOLed 5 years in the future, this patch set is so large, that it is very unlikely to get approved by the Debian Release Managers. Is there a way to strip this down to a minimum?

@RincewindsHat
Copy link
Member Author

@waja most of the changes are formatting, the essentials are not that big. If I find the time I can try to build a minimalist version of this.

@RincewindsHat
Copy link
Member Author

@waja
Copy link
Member

waja commented Sep 25, 2025

@waja
Copy link
Member

waja commented Sep 25, 2025

I've created https://salsa.debian.org/nagios-team/monitoring-plugins/-/commit/dd1efc8f1be4d98463c567589a657a0e22fb06d4 for this, many thanks!

hi @RincewindsHat, there is feedback from the BTS:

I've cloned the https://salsa.debian.org/nagios-team/monitoring-plugins.git repository and built a package with gbp buildpackage --git-ignore-branch on the 'trixie' branch.

Once installed onto the target server running MySQL 8.4 I see the following:

jon@TRIXIESERVER:~$ /usr/lib/nagios/plugins/check_mysql -u REDACTED -p REDACTED
Uptime: 21151 Threads: 9 Questions: 1855375 Slow queries: 0 Opens: 2137 Flush tables: 3 Open tables: 804 Queries per second avg: 87.720|Connections=724c;;;; Open_files=9;;;; Open_tables=804;;;; Queries=1855376c;;;; Questions=1652c;;;; Table_locks_waited=0c;;;; Threads_connected=2;;;; Threads_running=3;;;; Uptime=21151c;;;;

jon@TRIXIESERVER:~$ /usr/lib/nagios/plugins/check_mysql -u REDACTED -p REDACTED -S
Not a known sever implementation: 8.4.6

I think beside the "sever" typo, there seems to be a different issue. :)

@RincewindsHat
Copy link
Member Author

well, should have tested that against a real MySQL(tm) server. That also needs repair in the master branch, so thanks to the person reporting this.
Anyway, I pushed another commit to that branch, should fix it.

@waja
Copy link
Member

waja commented Sep 27, 2025

Anyway, I pushed another commit to that branch, should fix it.

The latest patchset seems to result into:

jon@SERVER:~$ /usr/lib/nagios/plugins/check_mysql -u REDACTED -p REDACTED -S
Slave status unavailable

Server version is 8.4.6 MySQL Community Server - GPL

@waja
Copy link
Member

waja commented Sep 30, 2025

Anyway, I pushed another commit to that branch, should fix it.

The latest patchset seems to result into:

jon@SERVER:~$ /usr/lib/nagios/plugins/check_mysql -u REDACTED -p REDACTED -S
Slave status unavailable

Server version is 8.4.6 MySQL Community Server - GPL

@RincewindsHat it looks like the issue isn't solved in 2.4.0 yet and I also don't know, if that is working in master. We don't have a test against a mysql cluster instance in our test pipelines. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

check_mysql supports replica check

3 participants