User Tools

Site Tools


computing:munin

  • munin
  • Jonathan Haack
  • Haack's Networking
  • oemb1905@jonathanhaack.com

munin


This tutorial is for users of Debian who have already established a host with TLS/LAMP and want to create a Munin instance to monitor the host. If you have not yet completed that, please begin with Apache Survival. Okay, as long as you have done that, let's proceed. First, install Munin and the apache webserver modules required for it to run:

sudo apt install munin
sudo apt install libcgi-fast-perl libapache2-mod-fcgid

If you have WordPress CMS enabled on this same server, or Nextcloud, etc., then you will likely have the fast cgi module enabled already. If not, then please enable as follows:

sudo a2enmod fcgid

Once that is done, we need to configure to files that come with Munin to enable it to work on your host. First, let's configure the primary configuration file:

cd /etc/munin
sudo nano munin.conf

Change the line that specifies the html directory here to reflect your location:

<htmldir /var/www/site1.com/public_html/munin>

Change the “host tree” name to something unique. Usually, “Munin” is sufficiently unique:

[Munin]
  address 127.0.0.1
  use_node_name yes

Create the directory for munin, apply appropriate permissions.

mkdir /var/www/site1.com/public_html/munin
chown munin:munin /var/www/site1.com/public_html/munin

Now configure the apache virtual host that munin provides, and configure overrides so it can populate that directory with its webpages/metrics, etc. After opening the file, go around and make sure the alias directory properly matches our entries above:

sudo nano apache24.conf
<Alias /munin /var/www/site1.com/public_html/munin>

After that, you need to change the override status, in the primary block, from:

<Directory /var/cache/munin/www>
  Require local
  Options None
</Directory>

To:

<Directory /var/www/site1.com/public_html/munin/>
  Require all granted
  Options FollowSymLinks SymLinksIfOwnerMatch
</Directory>

Once that is done, restart the web server and the munin services:

sudo systemctl restart munin-node
sudo systemctl restart apache2

The first thing you can do to verify your setup worked is navigate to the munin alias on your terminal and if it populated the munin webpages inside that directory, then the munin-node is working properly with apache.

cd /var/www/site1.com/public_html/munin/
ls -lah
<If you succeed, munin will populate this directory with .html files and a few directories.>

That's all that is required for a directory set-up (not a node), so navigate to the site now as follows:

https://site1.com/munin/

This should get you started! My instance is located here:

https://monitor.haacksnetworking.com/munin/

Happy hacking!

oemb1905 2020/01/17 10:15

computing/munin.txt · Last modified: 2020/01/17 10:15 by oemb1905