0

I installed munin-node on CentOS 7. The default plugin to monitor system resources is working fine. I followed the steps online to enable the mysql_ plugin. However, I'm encountering the following error:

> sudo munin-run --debug mysql_
# Skipping systemd properties simulation due to lack of permissions.
# Processing plugin configuration from /etc/munin/plugin-conf.d/00-default
# Processing plugin configuration from /etc/munin/plugin-conf.d/munin-node
# Processing plugin configuration from /etc/munin/plugin-conf.d/mysql
# Setting /rgid/ruid/ to /4257/498/
# Setting /egid/euid/ to /4257 4257/498/
# Setting up environment
# Environment mysqlpassword = password
# Environment mysqlconnection = DBI:mysql:information_schema;mysql_read_default_file=/etc/my.cnf
# Environment mysqluser = munin
# Environment mysqladmin = /usr/bin/mysqladmin
# About to run '/etc/munin/plugins/mysql_'
Unknown graph  at /etc/munin/plugins/mysql_ line 1805.

It seems to be an issue with the plugin code itself. Has anyone else encountered a similar issue and/or has a fix?

Setup steps

  1. $ sudo yum install munin-node
  2. $ sudo ln -s /usr/share/munin/plugins/mysql_ /etc/munin/plugins/mysql_
  3. Create /etc/munin.plugin-conf.d/mysql with:
[mysql*]
env.mysqlconnection DBI:mysql:information_schema;mysql_read_default_file=/etc/my.cnf
env.mysqluser munin
env.mysqlpassword munin
  1. Create munin user in MySQL:
CREATE USER 'munin'@'localhost' IDENTIFIED BY 'munin';
GRANT PROCESS, SUPER ON *.* TO 'munin'@'localhost';
GRANT SELECT ON mysql.* TO 'munin'@'localhost';
FLUSH PRIVILEGES;
  1. $ sudo systemctl restart munin-node
Francis
  • 183
  • 2
  • 9
  • Which steps did you include? There's meant to be multiple generated symlinks to this file but not the file itself? Its been a while but did you look at the instructions in the actual file? – danblack Nov 12 '20 at 01:29
  • @danblack, I updated the post with setup steps. – Francis Nov 13 '20 at 01:13

2 Answers2

0

The default MySQL plugin shipped with the munin-node installation didn't work for us (with the error mentioned in the original post).

Instead, we found this alternate plugin that worked of us:

https://github.com/kjellm/munin-mysql

As CentOS 7 uses systemd, you'll have to change the line in the Makefile that's $(MUNIN_NODE) restart to systemctl restart munin-node.

Hopefully, this helps others that may encounter the same issue we did.

Francis
  • 183
  • 2
  • 9
0

I had the same problem with munin 2 on CentOS 7.7.

mysql_ and mysql_connection didn't work, but mysql_connections is working fine, I don't know why, but these steps made it work for me.

Step 1: Change symbolic link name

mv /etc/munin/plugins/mysql_ /etc/munin/plugins/mysql_connections

Step 2: Update config file, in my case, it is /etc/munin/plugin-conf.d/munin-node (path depends on your system)

[mysql_*]
env.mysqluser your_user
env.mysqlpassword your_user_password
env.mysqlopts -u your_user --password=your_user_password # don't use -p 
env.mysqladmin /usr/local/mysql/bin/mysqladmin 
env.mysqlconnection DBI:mysql:db_name;host=127.0.0.1;mysql_read_default_file=/etc/my.cnf

Step 3: Test with --debug option

munin-run --debug mysql_connections

If there is any error like

Perhaps the DBD::mysql perl module hasn't been fully installed,

installing additional package will fix it.

yum install perl-DBD-mysql
le hien
  • 131
  • 2
  • 15