Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

According to several tutorials, the following should work:

Create a new user in MySQL.

$ mysql -uroot -p
> CREATE USER 'munin'@'localhost';
> exit;

Use that user in munin to access the database: edit /etc/munin/plugin-conf.d/munin-node. At [mysql*] set the following:

[mysql*]
env.mysqlopts -u munin

Strange thing, is that running

 /usr/sbin/munin-node-configure --suggest | grep mysql

Which tells me that MySQL cannot access the database and that it tries to access the database using user root:

[DBI connect('mysql;mysql_connect_timeout=5','root',...) failed: Access denied for user 'root'@'localhost' (using password: NO)

This is a CentOS 5.5 machine.

Why should munin-node-configure ignore the setting in /etc/munin/plugin-conf.d/munin-node? Should I set this elsewhere? Reloading or restarting the munin-node deamon changes nothing either.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

for me wildcards didnt seem to work either but the following did work

[mysql_queries]  
env.mysqlopts -u dev1
share|improve this answer
    
Thanks. Tried that, but it did not solve anything. to me, it looks like the configuration file is not loaded at all. –  berkes May 12 '11 at 7:57
    
This answer brought me on track. It turns out that munin-node-configure somehow ignores the settings in [mysql_queries], but once enabled and restarted the sensor /does/ turn up data. –  berkes May 17 '11 at 14:15

For Munin 1.4.7 there is error in documentation: mysql plugin looks for environment variables using another name.

You can check /usr/share/munin/plugins/mysql_

my %config = (
    'dsn'        => $ENV{'mysqlconnection'} || 'DBI:mysql:mysql',
    'user'       => $ENV{'mysqluser'}       || 'root',
    'password'   => $ENV{'mysqlpassword'}   || '',
);

So because the script doesn't check 'mysqlopts' I had to set up

[mysql*]
env.mysqluser username
env.mysqlpassword pass

then restart munin-node (just to be on the safe side).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.