[packages/nagios-plugin-check_mysql_health] Up to 3.0.0.5

arekm arekm at pld-linux.org
Fri Oct 9 12:30:29 CEST 2026


commit a9d29ddf54cda20570eaea5cb7c78694a25075a5
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Fri Oct 9 12:27:51 2026 +0200

    Up to 3.0.0.5

 nagios-plugin-check_mysql_health.spec | 19 +++++-------
 nobackdoor.patch                      | 56 ++++++++++++++++-------------------
 ssl.patch                             | 23 +++++++-------
 statedir.patch                        | 13 ++++++++
 4 files changed, 59 insertions(+), 52 deletions(-)
---
diff --git a/nagios-plugin-check_mysql_health.spec b/nagios-plugin-check_mysql_health.spec
index a5451b7..2013c00 100644
--- a/nagios-plugin-check_mysql_health.spec
+++ b/nagios-plugin-check_mysql_health.spec
@@ -2,22 +2,23 @@
 Summary:	Nagios plugin: monitor various performance-related characteristics of a MySQL DB
 Summary(pl.UTF-8):	Wtyczka Nagiosa monitorująca parametry wydajnościowe bazy danych MySQL
 Name:		nagios-plugin-%{plugin}
-Version:	2.2.2
-Release:	2
+Version:	3.0.0.5
+Release:	1
 License:	GPL v2+
 Group:		Networking
-Source0:	https://github.com/lausser/check_mysql_health/archive/ad90395e08beb1e24c428a056d81bfb7c624c929.zip
-# Source0-md5:	0bf1997673ce15f05809e8afaf7edd01
+Source0:	https://labs.consol.de/assets/downloads/nagios/%{plugin}-%{version}.tar.gz
+# Source0-md5:	b5ca985841064ce48fad57926c3f7491
 Source1:	%{plugin}.cfg
 Patch0:		nobackdoor.patch
 Patch1:		ssl.patch
+Patch2:		statedir.patch
 URL:		https://omd.consol.de/docs/plugins/check_mysql_health/
 BuildRequires:	autoconf
 BuildRequires:	automake
-BuildRequires:	libtool
 BuildRequires:	rpm-perlprov >= 4.1-13
 BuildRequires:	sed >= 4.0
 Requires:	nagios-common >= 3.2.3-3
+Requires:	perl-DBD-mysql
 Obsoletes:	nagios-plugin-check_mysql_perf
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -35,12 +36,12 @@ Wtyczka Nagiosa pozwalająca na monitorowanie różnych parametrów bazy
 danych MySQL związanych z wydajnością.
 
 %prep
-%setup -q -n %{plugin}-ad90395e08beb1e24c428a056d81bfb7c624c929
+%setup -q -n %{plugin}-%{version}
 %patch -P0 -p1
 %patch -P1 -p1
+%patch -P2 -p1
 
 %build
-%{__libtoolize}
 %{__aclocal}
 %{__autoconf}
 %{__automake}
@@ -50,11 +51,7 @@ danych MySQL związanych z wydajnością.
 	--host=%{_host} \
 	--build=%{_host} \
 	--with-perl=%{__perl} \
-	--libdir=%{plugindir} \
 	--libexecdir=%{plugindir} \
-	--with-mymodules-dir=%{plugindir} \
-	--with-mymodules-dyn-dir=%{plugindir} \
-	--with-statefiles-dir=%{statedir} \
 	--with-nagios-user=nagios \
 	--with-nagios-group=nagios
 %{__make}
diff --git a/nobackdoor.patch b/nobackdoor.patch
index 0cb9d99..00b2959 100644
--- a/nobackdoor.patch
+++ b/nobackdoor.patch
@@ -1,33 +1,29 @@
-From 9f60aab7d08a61638cc586bafe007b97ea614f3f Mon Sep 17 00:00:00 2001
-From: Vincevrp <vince at vince.sh>
-Date: Mon, 27 Feb 2023 11:48:25 +0100
-Subject: [PATCH] Remove shell backdoor parameter
+Drop the hidden --shell option, which spawns /bin/sh from the plugin.
 
----
- plugins-scripts/check_mysql_health.pl | 6 ------
- 1 file changed, 6 deletions(-)
-
-diff --git a/plugins-scripts/check_mysql_health.pl b/plugins-scripts/check_mysql_health.pl
-index 613dc19..e4cbbf1 100755
---- a/plugins-scripts/check_mysql_health.pl
-+++ b/plugins-scripts/check_mysql_health.pl
-@@ -314,7 +314,6 @@ ($$)
-     "method=s",
-     "runas|r=s",
-     "scream",
--    "shell",
-     "eyecandy",
-     "encode",
-     "units=s",
-@@ -475,11 +474,6 @@ ($$)
-   exit;
+--- a/GLPlugin/lib/Monitoring/GLPlugin.pm
++++ b/GLPlugin/lib/Monitoring/GLPlugin.pm
+@@ -241,13 +241,6 @@
+       hidden => 1,
+   );
+   $self->add_arg(
+-      spec => 'shell',
+-      help => "--shell
+-   forget what you see",
+-      required => 0,
+-      hidden => 1,
+-  );
+-  $self->add_arg(
+       spec => 'drecksptkdb=s',
+       help => "--drecksptkdb
+    This parameter must be used instead of --name, because Devel::ptkdb is stealing the latter from the command line",
+@@ -864,10 +857,6 @@
+     }
+     exit;
+   }
+-  if ($self->opts->shell) {
+-    # So komme ich bei den Narrischen zu einer root-Shell.
+-    system("/bin/sh");
+-  }
  }
  
--if (exists $commandline{shell}) {
--  # forget what you see here.
--  system("/bin/sh");
--}
--
- if (! exists $commandline{statefilesdir}) {
-   if (exists $ENV{OMD_ROOT}) {
-     $commandline{statefilesdir} = $ENV{OMD_ROOT}."/var/tmp/check_mysql_health";
+ 
diff --git a/ssl.patch b/ssl.patch
index da02cad..42f8889 100644
--- a/ssl.patch
+++ b/ssl.patch
@@ -1,11 +1,12 @@
-diff -ru check_mysql_health-ad90395e08beb1e24c428a056d81bfb7c624c929.org/plugins-scripts/Nagios/DBD/MySQL/Server.pm check_mysql_health-ad90395e08beb1e24c428a056d81bfb7c624c929/plugins-scripts/Nagios/DBD/MySQL/Server.pm
---- check_mysql_health-ad90395e08beb1e24c428a056d81bfb7c624c929.org/plugins-scripts/Nagios/DBD/MySQL/Server.pm	2016-05-13 11:13:09.000000000 +0200
-+++ check_mysql_health-ad90395e08beb1e24c428a056d81bfb7c624c929/plugins-scripts/Nagios/DBD/MySQL/Server.pm	2025-10-27 22:00:34.747637952 +0100
-@@ -975,6 +975,7 @@
-     }
-     $self->{dsn} = "DBI:mysql:";
-     $self->{dsn} .= sprintf "database=%s", $self->{database};
-+    $self->{dsn} .= ";mysql_ssl=1;mysql_ssl_mode=PREFERRED";
-     if ($self->{mycnf}) {
-       $self->{dsn} .= sprintf ";mysql_read_default_file=%s", $self->{mycnf};
-       if ($self->{mycnfgroup}) {
+Prefer TLS; mysql_ssl=1 alone makes DBD::mysql require it.
+
+--- a/plugins-scripts/Classes/Mysql/DBI.pm
++++ b/plugins-scripts/Classes/Mysql/DBI.pm
+@@ -8,6 +8,7 @@
+   my $dbi_options = { RaiseError => 1, AutoCommit => $self->opts->commit, PrintError => 1 };
+   my $dsn = "DBI:mysql:";
+   $dsn .= sprintf "database=%s", $self->opts->database;
++  $dsn .= ";mysql_ssl=1;mysql_ssl_optional=1";
+   if ($self->opts->mycnf) {
+     $dsn .= sprintf ";mysql_read_default_file=%s", $self->opts->mycnf;
+     if ($self->opts->mycnfgroup) {
diff --git a/statedir.patch b/statedir.patch
new file mode 100644
index 0000000..a479610
--- /dev/null
+++ b/statedir.patch
@@ -0,0 +1,13 @@
+Keep state files in /var/spool/nagios instead of world-writable /var/tmp.
+
+--- a/GLPlugin/lib/Monitoring/GLPlugin.pm
++++ b/GLPlugin/lib/Monitoring/GLPlugin.pm
+@@ -371,7 +371,7 @@
+     } elsif (exists $ENV{OMD_ROOT}) {
+       $self->override_opt('statefilesdir', $ENV{OMD_ROOT}."/var/tmp/".$Monitoring::GLPlugin::plugin->{name});
+     } else {
+-      $self->override_opt('statefilesdir', "/var/tmp/".$Monitoring::GLPlugin::plugin->{name});
++      $self->override_opt('statefilesdir', "/var/spool/nagios/".$Monitoring::GLPlugin::plugin->{name});
+     }
+   }
+   $Monitoring::GLPlugin::plugin->{statefilesdir} = $self->opts->statefilesdir
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/nagios-plugin-check_mysql_health.git/commitdiff/a9d29ddf54cda20570eaea5cb7c78694a25075a5



More information about the pld-cvs-commit mailing list