Munin is a network resource monitoring tool. It allows you to collect data from multiple servers simultaneously and display everything in graphs.

The system itself consists of two independent parts: the server (the munin itself), installed on the one machine where all the data will be collected, and a small munin-node daemon which is installed on the machines we will monitor. This daemon itself is a small Perl script which listens on port 4949 using Net::Server. On startup it looks through the plugins installed in /etc/munin/plugins and remembers their names. Every 5 minutes the munin server connects to all nodes, gets information from all plugins and saves it to the rrdtool database. Thus, you don't even need MySQL to run Munin.

Debian/Ubuntu

Install munin and munin-node

# apt-get install munin munin-node

Open file /etc/munin/munin.conf, change in it [localhost.localdomain] to [localhost] and save it.

Check for /etc/apache2/conf.d/munin

Edit the lines Allow from localhost 127.0.0.0/8 ::1 to Allow from all and save the file.

Restart the apache webserver

# service apache2 restart

If there is no /etc/apache2/conf.d/munin file, create one with the following contents:


Alias /munin /var/cache/munin/www  
<Directory /var/cache/munin/www&gt
       Order allow,deny
       Allow from all
       Options None
      <IfModule mod_expires.c>
               ExpiresActive On
               ExpiresDefault M310
      </IfModule></Directory>

ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph  
&lt;Location /munin-cgi/munin-cgi-graph&gt
       Order allow,deny
       Allow from all
      <IfModule mod_fastcgi.c>
               SetHandler fastcgi-script
      </IfModule></Location>

ScriptAlias /munin-cgi/munin-cgi-html /usr/lib/munin/cgi/munin-cgi-html  
&lt;Location /munin-cgi/munin-cgi-html&gt
       Order allow,deny
       Allow from all
      <IfModule mod_fastcgi.c>
               SetHandler fastcgi-script
      </IfModule></Location></directory>

Restart apache webserver

# service apache2 restart

CentOS

Install munin and munin-node

# yum install munin munin-node

Create a folder in which statistics files will be generated

# mkdir -p /var/www/html/munin

In file /etc/munin/munin.conf uncomment the line #htmldir /var/www/html/munin (remove the slash before htmldir) and save it.

Make the user munin the owner of the folder /var/www/html/munin

# chown munin:munin /var/www/html/munin

Run the munin-node

# service munin-node start

Activate the web interface

# echo ` ` &gt; /etc/httpd/conf.d/munin.conf

Open file /etc/httpd/conf.d/munin.conf and write there:

&lt;directory /var/www/html/munin&gt
ExpiresActive On  
ExpiresDefault M310  

ScriptAlias /munin-cgi/munin-cgi-graph /var/www/cgi-bin/munin-cgi-graph  

Restart the apache webserver

# service httpd restart

Now you can go to http://IP_сервера/munin in your web browser and see the statistics.

Updated July 27, 2018