The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to fix Munin errors: root@localhost cpanel mysql

Discussion in 'cPanel Developers' started by nichiyume, Jan 13, 2007.

  1. nichiyume

    nichiyume Member

    Joined:
    Nov 18, 2004
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Phoenix, Az
    Seems many have this problem trying to get munin's graphs to show mysql.

    When you look at the logs, you see this error.
    Code:
    tail /var/log/munin/munin-node.log
    CONNECT TCP Peer: "127.0.0.1:36819" Local: "127.0.0.1:4949"
    /usr/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)'
    This is from the mysqladmin location environment variables being lost due to a bug.

    Cpanel installs a configuration file with a simple mysql portion. This is what I changed it to.
    Code:
    root@moo [/etc/munin]# vi /etc/munin/plugin-conf.d/cpanel.conf
    [mysql*]
    user root
    group wheel
    env.mysqladmin /usr/bin/mysqladmin
    env.mysqlopts --defaults-extra-file=/root/.my.cnf 
    Not only does it use root, now it knows where mysqladmin is, and then a configuration file to login. In a rare case you might have to change the mysql root password to sync, easily done in WHM. /root/.my.cnf has the root mysql password in it. Protect it!

    In order to get the new variables to work, you have to run as root a forced update.
    Code:
    killall munin-node
    /usr/share/munin/munin-update  --force-root
    service restart munin-node 
    
    You can run munin-update as user munin later since it throws a fit when you run it as root.
    Code:
    killall munin*
    su -l munin /usr/share/munin/munin-update
    service restart munin-node
    
    Check the log for errors. The error message for root'@'localhost' (using password: NO)' has dissappeared!
    Code:
    tail /var/log/munin/munin-node.log -n 100
    I ended up having to reboot the whole server due to not munin not working at all after hours of work. All of the graphs work fine! I still get some Exim error, but the graphs work and I Don't care.

    RayRay
    cyborgcow.net forums Free gallery my webpage
    I know a guy named Sig
     
    #1 nichiyume, Jan 13, 2007
    Last edited: Jan 13, 2007
Loading...
Similar Threads - fix Munin errors
  1. markskayff
    Replies:
    5
    Views:
    49

Share This Page