Munin is a web-based resource monitoring tool that can help analyze resources and utilization of servers and services. It offers monitoring and alerting services for servers, switches, applications, services. Munin has a master / slave architecture in which master connects to all slaves at regular intervals and requests their data, which is then stored in RRD files.
It alerts users when things go wrong and alerts them the second time the problem has been resolved.
Today we will install Munin on CentOS 7.
Login to the server using SSH:
ssh [email protected]_ip
Before starting, enter the following command to check if you have the correct version of CentOS installed on your machine:
Should give you the result below:
CentOS Linux release 7.2.1511 (Core)
Update the system
Make sure your server is fully updated to the latest version:
After completing the update, install the EPEL repository:
yum install epel-release
Now you can install Munin and Apache with the following command:
yum install munin munin-node httpd -y
Once the installation is complete, start Munin and enable it to start at boot.
systemctl start munin-node systemctl enable munin-node
When a restart is needed, you can use systemctl restart munin-node to restart Munin.
Check the file /etc/munin/munin.conf, have permission, use the line below:
[localhost] address 127.0.0.1 use_node_name yes
You can either open the file with a text editor or use the command grep… For example, to test a set of addresses, you can use:
grep address /etc/munin/munin.conf
Using the utility htpasswd we will create a username and password for basic authentication, thus a password protecting Munin. Enter the following command:
htpasswd /etc/munin/munin-htpasswd admin
When prompted, as shown below, enter the password for the admin user:
New password: Re-type new password: Adding password for user admin
Add your proxy name to the file Munin-node.conf… Open it with a text editor of your choice. We are using nano:
You can add the line hostname at the end of the file. For instance:
Save and close the file.
Open Munin Apache configuration and add the following lines to the directory / var / www / html / munin:
nano /etc/httpd/conf.d/munin.conf Order Deny,Allow Deny from all Allow from 127.0.0.1 your_public_IP
Once added, the section should look like this:
<directory /var/www/html/munin> AuthUserFile /etc/munin/munin-htpasswd AuthName "Munin" AuthType Basic require valid-user Order Deny,Allow Deny from all Allow from 127.0.0.1 your_public_IP
Restart Apache for the changes to take effect:
systemctl restart httpd
Congratulations. You have successfully installed Munin on your CentOS 7. Now open your web browser and navigate to the following HTTP address: // your_server_IP / Munin and enter the logging credentials you just set up with the utility Htpasswd…
Below are some of the screenshots we took from Munin monitoring our Linux OS downtime.