skip to Main Content

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

2

Answers


  1. Chosen as BEST ANSWER

    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.


  2. 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
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search