Tag Archives: munin

install_driver(mysql) failed: Can’t load ‘/usr/lib64/perl5/vendor_perl/auto/DBD/mysql/mysql.so’ for module DBD::mysql: libmysqlclient.so.16:

Fix.

su – munin
vi ~/.bash_profile
export LD_LIBRARY_PATH=$PATH:/usr/local/cpanel/3rdparty/lib64/mysql
munin-run mysql_connections

but this works only from curret shell session, so you need:

vi /etc/ld.so.conf.d/munin.conf
/usr/local/cpanel/3rdparty/lib64/mysql
ldconfig
/etc/init.d/munin-node restart

nginx status plugin for munin

nginx -V 2>&1 | grep -o with-http_stub_status_module
vi /etc/nginx/nginx.conf
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
allow your_IP;
deny all;
}
service nginx reload

vi /etc/munin/plugin-conf.d/nginx_
[nginx*]
env.url http://localhost/nginx_status

cd /etc/munin/plugins/
sudo ln -sf /usr/share/munin/plugins/nginx_* .
service munin-node restart

centos install munin

yum –enablerepo=epel -y install munin munin-node
vi /etc/httpd/conf/httpd.conf:

Alias /munin /var/www/html/munin

Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all

/etc/init.d/httpd restart
chkconfig –levels 235 munin-node on
/etc/init.d/munin-node start

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.