Knowledge Base

    How to install Munin on Ubuntu and CentOS

    Munin is a free monitoring system. It allows you to collect data from multiple servers simultaneously and display everything in clear and intuitive graphs. It has modular architecture, and works based on the “Master-Node” principle. It uses RRDtool to create graphs that are accessible via the web interface.

    The munin package is responsible for gathering information from the munin-node and generating the necessary graphs. It is installed only on the computer where the reports will be viewed.

    The munin-node package is a munin server, which is used to collect the necessary information from the system components and transfers it to the munin server.

    Installing and configuring the munin server

    Munin is installed running the following command:


    sudo yum install munin munin-node rrdtool


    sudo apt-get install munin munin-node rrdtool

    By default, Munin creates an Apache configuration file in

    CentOS: /etc/httpd/conf.d/munin.conf

    Ubuntu: /etc/munin/apache.conf (simlink /etc/apache2/conf.d/munin)

    Add the following line in CentOS

    /etc/httpd/conf.d/munin.conf: Alias /munin /var/www/html/munin

    Then change /etc/munin/munin.conf

    Uncomment the lines:

    /etc/munin/munin.conf: [...] dbdir /var/lib/munin htmldir /var/www/html/munin/ #CentOS htmldir /var/cache/munin/www #Ubuntu logdir /var/log/munin rundir /var/run/munin [...] [your_server_name] address use_node_name yes [...]

    Then the client machine(s) are added. To do it, add the following line to the same file:

    [client2] address 192.X.Х.Х

    Set the necessary rights to Munin, running the command:


    chown -R munin:munin /var/www/html/munin/


    chown -R munin:munin /var/cache/munin/www

    Installing and configuring the munin client


    sudo yum install munin-node rrdtool


    sudo apt-get install munin-node rrdtool

    Indicate the client machine’s name in the configuration file /etc/munin/munin-node.conf

    #host_name localhost.localdomain host_name client2

    Next, you must allow access from the server to the client machines. To do this, you must specify the IP address of the server. In this block, you can specify several servers at once.

    allow ^$ allow ^$

    Afterwards, restart the Munin client:

    /etc/init.d/munin-node restart

    Configuring authorization in the web interface

    After having connected to the server, it is necessary to bring the configuration file munin.conf to the following form:


    /etc/httpd/conf.d/munin.conf: <directory /var/www/html/munin> AuthUserFile /etc/munin/munin-htpasswd AuthName "Munin" AuthType Basic require valid-user ExpiresActive On ExpiresDefault M310 </directory> ScriptAlias /munin-cgi/munin-cgi-graph /var/www/cgi-bin/munin-cgi-graph


    /etc/munin/apache.conf: <Directory /var/cache/munin/www> Order allow,deny Allow all Options None AuthUserFile /etc/munin/munin-htpasswd AuthName "Munin" AuthType Basic require valid-user <IfModule mod_expires.c> ExpiresActive On ExpiresDefault M310 </IfModule> </Directory>

    Running Munin

    First, you need to connect to the server, and then run the following commands:


    sudo /etc/init.d/munin-node start


    sudo initctl start munin-node

    In order for the application to start automatically after the server is turned on, you must run the following command:


    sudo chkconfig munin-node on


    sudo update-rc.d munin-node defaults

    Then update the web-server configuration files:


    sudo service httpd reload


    sudo service apache2 reload

    To check performance, go to the following address http://yourservername/munin/

    In the window that opens, choose the required server and graph:

    Running Munin

    Only a few monitoring plugins are active by default. There are many other plugins available and, if necessary, you can add them by creating a symbolic link to the plugin.

    A complete list can be found in the directory /usr/share/munin/plugins/

    ln -s /usr/share/munin/plugins/apache_servers /etc/munin/plugins/

    Restart the munin-node service in your munin client

    sudo service munin-node restart