How to Install and Setup Munin on CentOS 7

Munin on CentOS 7

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.

Steps to 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

See also  How to Check Routing Table on Linux CentOS 6.2

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

3. Start and enable apache and munin at boot.

# systemctl start httpd
# systemctl enable httpd
# systemctl start munin-node
# systemctl enable munin-node

4. 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

5. 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

6. 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
..
..

7. 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

8. Allow port 80 in the firewalld permanently. learn more how to configure Firewalld on CentOS 7.

See also  How to Install and Configure ProFTPD FTP Server on Ubuntu 14.04

a) Get default zone :

# firewall-cmd --get-active-zones
public
  interfaces: ens160

b) Allow port 80 permanently in firewalld :

# firewall-cmd --permanent --zone=public --add-port=80/tcp
success

c) reload the setting to take effect immediately :

# firewall-cmd --reload
success

d) List all active firewalld configuration :

# firewall-cmd --list-all
public (default, active)
  interfaces: ens160
  sources:
  services: dhcpv6-client ssh
  ports: 80/tcp
  masquerade: no
  forward-ports:
  icmp-blocks:
  rich rules:

9. Try access munin statistic page from client.

http://192.168.0.14/munin

Munin on CentOS 7

Comments

Leave a Reply

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