loader

    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:

    CentOS:

    sudo yum install munin munin-node rrdtool

    Ubuntu:

    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 127.0.0.1 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:

    CentOS:

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

    Ubuntu:

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

    Installing and configuring the munin client

    CentOS:

    sudo yum install munin-node rrdtool

    Ubuntu:

    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 ^127.0.0.1$ allow ^10.52.31.41$

    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:

    CentOS:

    /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

    Ubuntu:

    /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:

    CentOS:

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

    Ubuntu:

    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:

    CentOS:

    sudo chkconfig munin-node on

    Ubuntu:

    sudo update-rc.d munin-node defaults

    Then update the web-server configuration files:

    CentOS:

    sudo service httpd reload

    Ubuntu:

    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