Monday, April 22, 2024
HomeHow toHow to Install Munin Monitoring Tool on Debian 12

How to Install Munin Monitoring Tool on Debian 12

Munin is a free and open-source system and network monitoring tool that displays system metrics in graphs through a web browser. The software works as a client-server model. IT can monitor its own resources and hundreds of remote machines via a web browser. It helps you to collect system information such as processor load, hard disk usage, network traffic, access to server services on one or more computers, and more.

This tutorial will show you how to install the Munin monitoring tool on Debian 12.

Prerequisites

  • A server running Debian 12.
  • A root password is configured on the server.

Install Apache Web Server

Munin can run on many web servers, including Apache, Nginx, and Lighttpd. In this post, we will install Apache for Munin.

You can install the Apache and other required packages with the following command:

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

Once all the packages are installed, you must enable the fcgid module. You can enable it using the following command:

a2enmod fcgid

Once you are done, restart the Apache service to apply the changes:

systemctl restart apache2

The Munin package is included in the Debian 12 default repository by default. You can install it using the following command:

apt install munin munin-node munin-plugins-extra -y

After installing all the packages, you must create an admin account and password to access Munin.

You can create it using the following command:

htpasswd -c /etc/munin/munin-htpasswd admin

Set your admin password as shown below:

New password: 
Re-type new password: 
Adding password for user admin

Once you are finished, you can proceed to the next step.

Configure Apache for Munin

During the Munin installation, an Apache configuration file will be created at /etc/munin/apache24.conf. You will need to copy it inside the Apache configuration directory.

cp -p /etc/munin/apache24.conf /etc/apache2/sites-available/munin.conf

Next, edit the Munin configuration file with the following command:

nano /etc/apache2/sites-available/munin.conf

Make the following changes:

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>
AuthUserFile /etc/munin/munin-htpasswd
Authtype Basic
AuthName "Munin"
Require valid-user
Options FollowSymLinks SymLinksIfOwnerMatch
Options None
</Directory>

<Directory /usr/lib/munin/cgi>
AuthUserFile /etc/munin/munin-htpasswd
Authtype Basic
AuthName "Munin"
Require valid-user
Options FollowSymLinks SymLinksIfOwnerMatch

<IfModule mod_fcgid.c>
SetHandler fcgid-script
</IfModule>
<IfModule !mod_fcgid.c>
SetHandler cgi-script
</IfModule>
</Directory>

Save and close the file then enable the Munin virtual host with the following command:

a2ensite munin

Next, restart the Apache and Munin service to apply the changes:

systemctl restart apache2
systemctl restart munin-node

You can check the status of the Munin with the following command:

systemctl status munin-node

You will get the following output:

? munin-node.service - Munin Node
     Loaded: loaded (/lib/systemd/system/munin-node.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2023-11-06 15:36:58 UTC; 7s ago
       Docs: man:munin-node(1)
             http://guide.munin-monitoring.org/en/stable-2.0/reference/munin-node.html
    Process: 30715 ExecStartPre=install -o munin -g munin -d /run/munin (code=exited, status=0/SUCCESS)
   Main PID: 30716 (munin-node)
      Tasks: 1 (limit: 4679)
     Memory: 9.2M
        CPU: 798ms
     CGroup: /system.slice/munin-node.service
             ??30716 /usr/bin/perl -wT /usr/sbin/munin-node --foreground

Nov 06 15:36:57 debian11 systemd[1]: Starting Munin Node...
Nov 06 15:36:58 debian11 systemd[1]: Started Munin Node.

You can also check the Apache status with the following command:

systemctl status apache2

You will get the following output:

? apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2023-11-06 15:36:51 UTC; 31s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 30700 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 30704 (apache2)
      Tasks: 7 (limit: 4679)
     Memory: 17.3M
        CPU: 115ms
     CGroup: /system.slice/apache2.service
             ??30704 /usr/sbin/apache2 -k start
             ??30705 /usr/sbin/apache2 -k start
             ??30706 /usr/sbin/apache2 -k start
             ??30707 /usr/sbin/apache2 -k start
             ??30708 /usr/sbin/apache2 -k start
             ??30709 /usr/sbin/apache2 -k start
             ??30710 /usr/sbin/apache2 -k start

Nov 06 15:36:51 debian11 systemd[1]: Starting The Apache HTTP Server...

Access Munin Web Interface

Now, open your web browser and access the Munin web interface using the URL http://your-server-ip/munin. You will be redirected to the Munin login page:

Provide your admin username, password and click on the Sign in button. You should see the Munin dashboard on the following page:

Conclusion

Congratulations! You have successfully installed the Munin monitoring server on Debian 12. You can now add a remote machine to the Munin server and monitor them from the web-based interface.

About Hitesh Jethva

Over 8 years of experience as a Linux system administrator. My skills include a depth knowledge of Redhat/Centos, Ubuntu Nginx and Apache, Mysql, Subversion, Linux, Ubuntu, web hosting, web server, Squid proxy, NFS, FTP, DNS, Samba, LDAP, OpenVPN, Haproxy, Amazon web services, WHMCS, OpenStack Cloud, Postfix Mail Server, Security etc.


RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here


spot_img

Most Popular