Install Munin Monitoring tool in RHEL 7/8, CentOS 7 and Fedora 28/29

0
54

in this tutorial i will show you, how to install Munin on CentOS 7 or Fedora 28/29 . Munin is a networked resource monitoring tool written in Perl and uses RRDtool to create graphs accessable from web interface. this tool giving the possibility to monitor and get alerts  from all kind of services ,servers, switches, and applications.

Information about my Munin Server

[root@munin ~]# ip a | grep inet
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
inet 192.168.2.98/24 brd 192.168.2.255 scope global noprefixroute dynamic enp0s3
inet6 2a02:a455:37bd:1:e01f:6f17:6209:5424/64 scope global noprefixroute dynamic
inet6 fe80::14a3:f26a:e5d2:e74e/64 scope link noprefixroute
[root@munin ~]# uname -a
Linux munin.osradar.lan 3.10.0-957.5.1.el7.x86_64 #1 SMP Fri Feb 1 14:54:57 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[root@munin ~]# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
[root@munin ~]#

1-update ur  Server

For Centos  /RHEL Servers

yum update -y

For  Fedora 28/29

dnf update -y

# yum update
2. Install the EPEL repository
How to install the EPEL repository on Centos7 or Fedora 29:

# yum install epel-release -y
# dnf install epel-release  -y

3. Install Munin and Apache
How to install Install Munin and Apache  in Centos and Fedora

Please use the below command:

# yum install   munin munin-node httpd -y
# dnf install   munin munin-node httpd -y

Here bellow you  find related munin files and  directories

  • /etc/munin/munin.conf : Munin master configuration file.
  • /etc/cron.d/munin : Munin cron file.
  • /etc/httpd/conf.d/munin.conf : Munin Apache configuration file.
  • /var/log/munin : Munin log directory.
  • /var/www/html/munin : Munin web directory.
  • /etc/munin/munin-node.conf : Munin Node master configuration file.
  • /etc/munin/plugins.conf : Munin plugins configuration file.

4. Install  and Configure Munin

Now   enable and , start Munin  on boot.

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

5.Configuration

Edit file /etc/httpd/conf.d/munin.conf,

# vi /etc/munin/munin.conf

Add/Edit as shown below.

#Uncomment the following lines
dbdir   /var/lib/munin
htmldir /var/www/html/munin
logdir /var/log/munin
rundir  /var/run/munin

[...]

# a simple host tree. Set your system name
[munin.osradar.lan]
address 127.0.0.1
use_node_name yes

 

Setup Apache  to be accessible from the local network

Edit file /etc/httpd/conf.d/munin.conf,

# vi /etc/httpd/conf.d/munin.conf

Add the following lines at the end.

<Directory /var/www/html/munin/>
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 192.168.2.0/24
</Directory>

6. Configure Munin master user
Use the htpasswd utility to  create a username and password for basic authentication,

lets make osradar user be able to access the site

# htpasswd /etc/munin/munin-htpasswd  osradar
New password:
Re-type new password:

The  HTTP munin configuration will be  like this

#cat /etc/httpd/conf.d/munin.conf

<Directory /var/www/html/munin/>

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

Order Deny,Allow
Deny from all
Allow from 127.0.0.1 192.168.2.0/24
</Directory>

7.Restart apache

Check if  any warnings of errors displaying.

# systemctl restart httpd

7.1-Configure the fireWall

allow connection to port 80  ( http service)

[root@munin ~]# firewall-cmd --permanent --add-service=http
success
[root@munin ~]# firewall-cmd --reload
success
[root@munin ~]#

8.Try access  the  Server  http://host/munin

How to add Monitoring Client  to Munin

My Cllient is Centos server with ip adress : 192.168.2.165  and hostname  osradarClient

Go to your client systems and install munin-node package.

#yum  update
yum  install  epel-release
# yum install munin-node -y

Configure the node

Edit file /etc/munin/munin-node.conf,

# vi /etc/munin/munin-node.conf
Set client hostname and specify Munin server IP address.

[...]
host_name osradarClient

[...]

allow ^192\.168\.2\.98$
allow ^::1$

[...]

osradarClient is my client hostname and 192.168.2.98 is my Munin server.

Start and  enable  munin-node service on your client system.

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

Back to  your Munin server and add the client system host name and ip address in /etc/munin/munin.conf file

# vi /etc/munin/munin.conf
Add the following lines.

[osradarClient]
address 192.168.2.165
use_node_name yes

Save and exit .

Very  important   :

To fetch data from clients. the firewall port  4949 should be  open

 [root@osradarClient ~]# firewall-cmd --permanent --add-port=4949/tcp
success
[root@osradarClient ~]# firewall-cmd --reload
success

Check the logs on the Munin Server /var/log/munin

You  have to wait some minutes to build data  before to be pushed to the graphs

Please  Enjoy

Enjoy

LEAVE A REPLY

Please enter your comment!
Please enter your name here