network monitoring with 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 ApacheSurvival. (As always, please refer to the Wiki post here for the latest instructions and documentation.)

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

Now that you are done with that, we need to enable an apache virtual host configuration file that resides within the base configuration files for Munin. That file’s location and basic configuration are below:

sudo nano apache24.conf

After that, you need to change the override status 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

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/

If you need to set up a node instead of a directory, then you need to provide additional configurations beyond what was discussed here, but this should get you started. My instance is located here:

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

Happy hacking!

— //[[oemb1905@jonathanhaack.com|oemb1905]] 2019/12/23 22:49//

Leave a Reply

Close