# Munin

Munin is open source and free software for monitoring computer system, network monitoring and application infrastructure monitoring software. Munin offers monitoring and alerting for servers, switches, applications, and services.

Munin can help system administrators to analyze the trend of the computer system whether it is experiencing problems or not. It can be an easier alternative to the popular open-source software zabbix monitoring.

In this article, I will explain how you can monitor your linux CentOS with Munin and the simple steps to install and setup Munin on CentOS 7.

# Install and Setup Munin on CentOS 7

  1. Enable or install the EPEL Repository into CentOS 7. Read more on how to Enable EPEL Repository on CentOS 7 / RHEL 7

  2. Munin requires a web server to run. In this article, we will use apache. Install apache, Munin and Munin Node with yum command:

yum install httpd munin munin-node -y
  1. Start and enable apache and munin at boot.
systemctl start httpd
systemctl enable httpd
systemctl start munin-node
systemctl enable munin-node
  1. We want munin to use the name centos72.ehowstuff.local instead of localhost. Please open edit the setting in /etc/munin/munin.conf
vim /etc/munin/munin.conf

Original:

[localhost]
    address 127.0.0.1
    use_node_name yes

Change to:

[centos72.ehowstuff.local]
    address 127.0.0.1
    use_node_name yes
  1. You also have optional to change the munin node hostname:
vim /etc/munin/munin-node.conf

Original:

host_name localhost.localdomain

Change to:

host_name centos72.ehowstuff.local

Next go to the Apache virtual host configuration file to add the permission to access your network.

vim /etc/httpd/conf.d/munin.conf

Add network segment that you allow to access to the CentOS server.

AuthUserFile /etc/munin/munin-htpasswd
AuthName "Munin"
AuthType Basic
require valid-user

Order Deny,Allow
Deny from all
Allow from 127.0.0.1 192.168.0.0/24
..
..
  1. Munin statistics page shall be protected by a username and password. We can add the new user (admin) and password to /etc/munin/munin-htpasswd with htpasswd command line. So we have to setup basic Apache authentication before we can start access the munin statistic page.
# htpasswd /etc/munin/munin-htpasswd admin
New password:
Re-type new password:
Adding password for user admin
  1. Allow port 80 in the firewalld permanently. learn more how to configure Firewalld on CentOS 7.