Breaking News

How to install Munin monitoring software on Ubuntu 20.04

So Munin is an old and easy monitoring software that graphs just about everything on servers, switches and what not. I always fall back on Munin when I want something that is very fast to set up, and low maintenance.

If you are like me, you often don’t want pages and pages on how to set it all up, and just want a one-liner or so to get going. For those who want that, skip to bottom.

Munin is divided into two packages for Ubuntu, munin and munin-node. The munin package is the master, and is installed on just one node where you can browse graphs for all servers. The munin-node is a smaller, and lighter package which is needed on other servers which you want to collect data from, to generate graphs on the master.

1. Install Apache and some other dependencies

We need to configure a web server on Ubuntu to access the web interface over a network of Munin. Therefore, use the below-given command to install Apache and other required packages.

apt install apache2 libcgi-fast-perl libapache2-mod-fcgid

2. Command to Install Munin

Munin can be installed from package sources on Ubuntu, hence we don’t need to add any additional or extra repository on our system.

apt install munin

3. Configure Apache for Munin Server monitoring

(optional) If you want to access the Munin Web interface outside your localhost, which means the server where you have installed this Server monitoring tool, then edit the Munin Apache configuration file.

vim /etc/munin/apache24.conf

Now, replace the line “Require local” with:

Require all granted

And also change the Options value from  None  to FollowSymLinks SymLinksIfOwnerMatch

It should now look something like this:

# ***** COMMON SETTINGS FOR ALL STRATEGIES *****

ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
Alias /munin/static/ /var/cache/munin/www/static/

<Directory /var/cache/munin/www>
    Require all granted
    Options FollowSymLinks SymLinksIfOwnerMatch
</Directory>

<Directory /usr/lib/munin/cgi>
    Require all granted
    Options FollowSymLinks SymLinksIfOwnerMatch
    <IfModule mod_fcgid.c>
        SetHandler fcgid-script
    </IfModule>
    <IfModule !mod_fcgid.c>
        SetHandler cgi-script
    </IfModule>
</Directory>


# ***** SETTINGS FOR CGI/CRON STRATEGIES *****

After this, we want to restart services and we are done 🙂

systemctl restart apache2 munin munin-node

You should now be able to browse your data at http://<hostname or ip of server>/munin. Since Munin only create new data/graphs each 5th minute, you might have to wait up to 5 minutes for first graphs to show up. In the mean time, you will only see a 403 Forbidden.

Fast track:

apt install apache2 libcgi-fast-perl libapache2-mod-fcgid munin -y
sed -i -e 's/Require local/Require all granted/g' /etc/munin/apache24.conf
sed -i -e 's/Options None/Options FollowSymLinks SymLinksIfOwnerMatch/g' /etc/munin/apache24.conf
systemctl restart apache2 munin munin-node

About philip

Legg igjen en kommentar