Package: munin-node
Version: 2.0.73-1
Severity: normal
File: /etc/munin/plugin-conf.d/munin-node

Dear Maintainer,

the plugin mysql_ fails in the default configuration:

command prompt # munin-run --debug mysql_slow
# Skipping systemd properties simulation due to lack of permissions.
# Processing plugin configuration from /etc/munin/plugin-conf.d/README
# Processing plugin configuration from /etc/munin/plugin-conf.d/dhcpd3
# Processing plugin configuration from /etc/munin/plugin-conf.d/munin-node
# Processing plugin configuration from /etc/munin/plugin-conf.d/mysql
# Processing plugin configuration from /etc/munin/plugin-conf.d/spamstats
# Setting /rgid/ruid/ to /117/0/
# Setting /egid/euid/ to /117 117/0/
# Setting up environment
# Environment mysqlopts = --defaults-file=/etc/mysql/debian.cnf
# Environment mysqlconnection = 
DBI:mysql:mysql;mysql_read_default_file=/etc/mysql/debian.cnf
# Environment mysqluser = root
# About to run '/etc/munin/plugins/mysql_slow'
DBI 
connect('mysql;mysql_read_default_file=/etc/mysql/debian.cnf;mysql_connect_timeout=5','root',...)
 failed: Access denied for user 'root'@'localhost' (using password: YES) at 
/etc/munin/plugins/mysql_slow line 1090.


changing the environment mysqluser to debian-sys-maint fixes it for me:

# munin-run mysql_slow
Slow_queries.value 1

I've attached a patch.

Regards

Carsten

>From 5955c2a0317b6170aa7a2941296eb39de89b6984 Mon Sep 17 00:00:00 2001
From: Carsten Leonhardt <l...@debian.org>
Date: Thu, 6 Jun 2024 18:36:18 +0200
Subject: [PATCH] Fix Debian default configuration for the plugin mysql_

mysql_ is told to refer to /etc/mysql/debian.cnf where there is a
password for the mysql user "debian-sys-maint", but it is also
instructed to use "root" as mysql user, for which there is no
password, so authentication fails.
---
 debian/plugins.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/plugins.conf b/debian/plugins.conf
index f49986e7..76c23bda 100644
--- a/debian/plugins.conf
+++ b/debian/plugins.conf
@@ -73,7 +73,7 @@ user root
 [mysql*]
 user root
 env.mysqlopts --defaults-file=/etc/mysql/debian.cnf
-env.mysqluser root
+env.mysqluser debian-sys-maint
 env.mysqlconnection DBI:mysql:mysql;mysql_read_default_file=/etc/mysql/debian.cnf
 
 [postfix_mailqueue]
-- 
2.39.2

Reply via email to