Getting Munin’s MySQL plugin working under CentOS
Install missing packages:
1 | yum install -y perl-Cache-Cache perl-IPC-ShareLite |
First, make sure that the user munin has the proper rights in MySQL:
1 2 3 4 5 | GRANT USAGE ON *.* TO munin IDENTIFIED BY "AwesomePassword"; GRANT SELECT ON mysql.* TO munin; GRANT PROCESS ON *.* TO munin; GRANT SUPER ON *.* TO munin; SHOW GRANTS FOR munin; |
Now, add the credentials to the MySQL section of /etc/munin/plugin-conf.d/munin-node:
1 2 3 | [mysql*] env.mysqluser munin env.mysqlpassword AwesomePassword |
Check the output from /usr/sbin/munin-node-configure –suggest and look for MySQL:
1 | mysql_ | yes | yes (bin_relay_log commands connections..) |
If the output looks good, write a new configuration file for munin-node with this command:
1 | /usr/sbin/munin-node-configure --shell --remove-also | sh |
Restart the service:
1 | /sbin/service munin-node restart |
Try to fetch a MySQL variable by connecting to munin-node with telnet:
1 2 3 4 5 6 7 8 9 10 11 12 | $ telnet localhost 4949 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. # munin node at ... fetch mysql_myisam_indexes Key_read_requests.value 46370071 Key_reads.value 28880 Key_write_requests.value 27113469 Key_writes.value 6936 . quit |
All is well.
Categories: Uncategorized