munin add mysql plugins

# Save this to /etc/munin/plugin-conf.d/mysql_
[mysql_*]
env.mysqlconnection DBI:mysql:mysql;host=127.0.0.1;port=3306
env.mysqluser munin
env.mysqlpassword pass

mysql> CREATE USER [email protected] IDENTIFIED BY ‘pass’;
mysql> GRANT SUPER,PROCESS ON *.* TO [email protected];
mysql> GRANT SELECT ON mysql.* TO [email protected];
mysql> FLUSH PRIVILEGES;

yum install perl-Cache-Cache

munin-node-configure –suggest 2>&1 | grep mysql
(munin-node-configure –shell 2>&1 | grep mysql | /bin/bash); service munin-node restart

check:
munin-run mysql_connections
max_connections.value 151
Max_used_connections.value 3
Aborted_clients.value 2
Aborted_connects.value 1
Threads_connected.value 3
Connections.value 36

telnet localhost 4949
Trying 1.2.3.4…
Connected to localhost.
Escape character is ‘^]’.
# munin node at localhost
fetch mysql_connections
max_connections.value 151
Max_used_connections.value 3
Aborted_clients.value 2
Aborted_connects.value 1
Threads_connected.value 3
Connections.value 38
.
quit
Connection closed by foreign host.

Leave a Reply

Your email address will not be published. Required fields are marked *