This tip is about the how to Install Munin on Ubuntu 20.04 for Server Monitoring. So read this free guide, How to Install Munin on Ubuntu 20.04 for Server Monitoring step by step. If you have query related to same article you may contact us.
How to Install Munin on Ubuntu 20.04 for Server Monitoring – Guide
Munin is a web-based tool for monitoring system and network statistics. Munin shows this information through graphics.
Let’s see how we can configure Munin on Ubuntu 20.04, let’s start by updating the package repositories and then installing the necessary package for the Munin and Apache web server
apt update
apt install munin libnet-netmask-perl libnet-telnet-perl libxml-parser-perl libxml-simple-perl libcache-cache-perl libdbd-mysql-perl libdbi-perl
apt install apache2 apache2-utils
Access to Munin is by default restricted locally to the server only.
Let’s change that and allow only authenticated users to access. This can be done by editing the /etc/apache2/conf-enabled/munin.conf file.
Requires location
Options None
Change the line above so that they look like
AuthType Basic
AuthName “Login required”
AuthUserFile /etc/apache2/htpasswd.munin
Requires valid user
Options None
To set a username/password run the command
1 htpasswd -c /etc/apache2/htpasswd.munin username
Now we can access Munin Graphs by visiting the url like http: // server-ip / munin /
Now we are going to add graphs for MySQL monitoring, to do this we first need to add a MySQL user who can read the necessary statistics.
1 CREATE USER ‘munin’ @ ‘localhost’ IDENTIFIED WITH unix_socket;
2 GRANT ON PROCESS *. * TO ‘munin’ @ ‘localhost’;
3 FLUSH PRIVILEGES;
We create a munin user that will be authenticated with unix_socket connection to mysql server.
We then set the connection string to mysql, create a new /etc/munin/plugin-conf.d/mysql file and add the following line to it
1 [mysql*]
2 env.mysqlconnection DBI: mysql: information_schema
3 env.mysqluser munin
Now, to check if user munin can’t for MySQL server, switch to user munin and run the commands
1 su – munin –shell = / bin / bash
2 munin-node-configure –suggest | mysql grep
The output should look like
1 mysql_ | no | yes (+ bin_relay_log + binlog_groupcommit + Command + connections + files_tables + innodb_bpool + innodb_bpool_act + innodb_insert_buf + innodb_io + innodb_io_pend + innodb_log + innodb_rows + innodb_semaphores + innodb_bpool_act + innodb_insert_buf + innodb_io + innodb_io_pend + innodb_log + innodb_rows + innodb_semaphores + innodb_tnfficx_tnfficx + myisampescocks + tabela_lent_index + myisampescocks_tabela_taca_dados + slow_dice_decorrespons + myisampescache )
The yes here means that we can create graphs for the listed mysql parameters.
The no here says they are not currently enabled, so let’s enable them
Run the command below to get the command to run to create the necessary symbolic links
1 munin-node-configure –shell | mysql grep
The output will be like
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_bin_relay_log’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_binlog_groupcommit’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_commands’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_connections’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_files_tables’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_innodb_bpool’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_innodb_bpool_act’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_innodb_insert_buf’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_innodb_io’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_innodb_io_pend’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_innodb_log’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_innodb_rows’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_innodb_semapores’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_innodb_tnx’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_myisam_indexes’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_network_traffic’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_qcache’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_qcache_mem’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_replication’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_select_types’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_slow’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_sorts’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_table_locks’
ln -s ‘/ usr / share / munin / plugins / mysql_’ ‘/ etc / munin / plugins / mysql_tmp_tables’
Now we need to create these symlinks as the root user, you can simply copy and paste the output from the above command to create the symlinks. Finally restart the munin-node service.
1
munin-node re service
Final note
I hope you like the guide How to Install Munin on Ubuntu 20.04 for Server Monitoring. In case if you have any query regards this article you may ask us. Also, please share your love by sharing this article with your friends.