Content
- page: Installation and overview of Munin server monitor system
- page: Install, uninstall, and set password protection for Munin plugins
The 1. page content
Introductory
By making the web and other services running on our server available to the public, there may be a need for a comprehensive monitoring system that allows us to track information about the utilization of various resources on our server from one place. Many of these softwares are available today, and in this tutorial we will look at the installation and commissioning of a server monitor package called Munin on Debian 9 (Stretch) and Debian 10 (Buster).
Munin is a featherweight program written in Perl that runs in the background (in cron) to gather information from every corner of the system from which to build its database. The other part of the program creates graphs from the collected data, which it then makes available through the web server. The greatness of the system lies in its simplicity: nothing is chilly, it just serves the various statistics in the form of png images pasted into simple html pages. Furthermore, thanks to its modular structure, many plugins can be obtained, for example GitHub Munin from their contributors page. Its interface is very simple, so we can easily monitor all points of our server. The system, which can be separated from the central part, is a so-called it is made up of nodes that need to be installed and run on the server you want to monitor, which then sends the data to the central part. As a result, Munin can monitor multiple servers from one location at a time, but in this guide we will only test the usage installed on one machine.
I also tested the description on a Debian 11 (Bullseye) system, everything works. In the case of installation on Debian 11, where the description splits, proceed with the Debian 10 parts.
Prerequisites
Munin Server Monitor can be installed on virtually any Debian environment, but Debian in your luggage Due to the differences in functionality between the available program versions, we will only cover the versions available on Debian 9 and Debian 10 here. In the previous Debian 8 (Jessie) repository the difference package is so old that it had to be brought to life in a different way. So you can use this description to install Munin server statistics on any of the following server configurations:
Minimum Servers:
- Debian 9 (Stretch) minimum server (Installation guide | download virtual machine)
- Debian 10 (Buster) minimum server (Installation guide | download virtual machine)
LAMP Servers:
- Debian 9 (Stretch) LAMP Server v1.0 (Installation guide | download virtual machine)
- Debian 10 (Buster) LAMP Server v1.0 (Installation guide | download virtual machine)
- Debian 11 (Bullseye) LAMP server v1.0 (Installation guide |
download virtual machine)
Perfect Servers:
- Perfect server: Debian 9 (stretch) v1.0 (Installation guide | download virtual machine) (installed)
- Perfect server: Debian 10 (Buster) v1.0 (Installation guide | download virtual machine) (installed)
- Perfect server: Debian 11 (Bullseye) v1.0 (Installation guide |
download virtual machine) (tested) - Perfect server: Debian 11 (Bullseye) v1.0 (installed in production environment) (Installation guide |
download virtual machine) (tested)
Of course, the more complex our server, the more services Munin can monitor, so the more justified its use. Of the above, I tested the Munin installation on the two featured servers. Accordingly, newer versions of servers will already include this add-on.
Preparations
For Debian 9 (Stretch), set up the backports repository
Debian 9 (Stretch) backports repository available at munin package 2.0.49version, which is the same as the Debian 10 (Buster) repository versions. Therefore, if you are installing on Debian 9, you need to configure the backports repository, because 2.0.33version.
To configure the repository, log in as root and open /etc/apt/sources.list in the dwarf-with:
nano /etc/apt/sources.list
And add the following lines:
deb http://ftp.debian.org/debian stretch-backports main contrib non-free deb-src http://ftp.debian.org/debian stretch-backports main contrib non-free
Updating libraries
After changing your luggage list, it is strongly recommended that you update your luggage database and packages in the usual way, and before installing smaller or larger ones:
apt-get update
apt-get upgrade
Then, if we look at the package it is apt-cache command, you can see the versions:
apt-cache policy munin
Outputs to Debian 9:
And Debian 10:
Installing Munin
Package dependencies and installing the base package
Of the server configurations listed earlier, these servers may already be installed on the perfect servers, but to make sure they work everywhere, run the following command:
apt-get -y install \
apache2 \
libapache2-mod-fcgid \
libcgi-fast-perl \
perl perl-base
Enable the fcgid package (this is already enabled on perfect servers):
a2enmod fcgid
Then install the Munin system packages.
Debian 9
For Debian 9, install separately from the backports repository:
apt install -t stretch-backports \
munin \
munin-common \
munin-node \
munin-plugins-core \
munin-plugins-extra
Debian 10/11
And install it on Debian 10 as usual:
apt-get -y install \
munin \
munin-common \
munin-node \
munin-plugins-core \
munin-plugins-extra
Configure configuration
Open your configuration file for editing:
nano /etc/munin/munin.conf
And make the following settings:
#dbdir /var/lib/munin #htmldir /var/cache/munin/www #logdir /var/log/munin #rundir /var/run/munin [...] #tmpldir /etc/munin/templates [...] # a simple host tree [szerverünk_FQDN_neve] address 127.0.0.1 use_node_name yes [...]
- Take out the comments highlighted in red
- Slightly below Replace the green highlighted part (in the original file: localhost.localdomain) on our server FQDN name (full name). If we don't know exactly, then this hostname It can also be read with the -f command. Here, make sure that the name of the server is between square brackets.
Configuring Apache
Open it for editing in Munin Apache configuration file:
nano /etc/munin/apache24.conf
And here are some changes:
[...] <Directory /var/cache/munin/www> #Require local Require all granted Options FollowSymLinks SymLinksIfOwnerMatch Options None </Directory> <Directory /usr/lib/munin/cgi> #Require local Require all granted Options FollowSymLinks SymLinksIfOwnerMatch <IfModule mod_fcgid.c> SetHandler fcgid-script </IfModule> <IfModule !mod_fcgid.c> SetHandler cgi-script </IfModule> </Directory> [...]
Here, too, in both blocks, comment on the Require location lines, and insert the extra 2x2 lines according to the green pattern.
Then restart Apache and munin node:
systemctl restart apache2
systemctl restart munin-node
Control of Munin
Check our Munin system in the browser server IP addresses or your hostname / munin subdirectory:
http://debian9.linuxportal.vm/munin/
http://debian10.linuxportal.vm/munin/
If we have done everything right, your start page will come in. In the left menu you can look at the graphs. But that's about the end of the description.
So Munin's core system comes to life, which already contains some plugins, but we can still install some as we like.
Web interface overview
This section was originally dedicated to the third page, but since the second page is longer than planned, it will provide a more optimal place to review web graphs. So the pictures in this section were taken after installing and configuring the plugins, so there are many more menus and graphs available. Of course, we do not cover every graph, only the most important ones. In addition, there are parts that do not work on the virtual machine (eg temperature sensors), which I replace with my server as a sample.
The interface itself, as I mentioned at the beginning, is very simple, low-cost, and in return we get an easy-to-read, almost comprehensive server analysis. Let's see Munin in action!
So when you re-enter the homepage, there are more categories of menus:
Apache
Going to the apache menu we find some graphs:
Here you can see one-day graphs of the different states of Apache. For example, how many queries the server receives on average per second, how many Apache workflows are currently running, etc ...
Clicking on any graph image will bring you to a more detailed page showing the daily, weekly, monthly and yearly graphs for that graph:
The graphs appear in the same way in other menus. As I mentioned, the interface is very simple, but with informative graphs you can get a quick overview of the status of our server.
The graph outages occurred during the virtual machine downtime as I have been making this description for several days and the virtual machine is not running continuously.
Disk
In this menu you can get detailed information about the hard drives in your machine:
There are a lot of graphs here, scrolling down a bit is worth mentioning also the data transfer and utilization graphs:
This virtual machine is, of course, idle, but with a richer server running multiple web pages, we can get usable data about how our drives are performing.
Mysql and mysql2
In the two mysql menus you can get a plethora of graphs for everything with your database server:
Scrolling down a bit further, this graph just shows the rate at which SQL operations are running on the server. For example, it can be used to assess how web pages you run use databases (read / write) to optimally select, for example, the ASPs and their deployment scheme (eg raid settings) for the next server build.
Network
There are many things you can do in the network section too:
For example, the amount of data passing through our firewall or the speed of HTTP page downloads. A little further down the Fail2Ban You can also find out the number of IP addresses blocked by. Interestingly, here's my monthly Fail2Ban image on my server:
Here, for example, the point is that since I banned a lot of robots, since then, the amount of prohibited IP addresses has fluctuated periodically, so they periodically try to come back. (But in return, there is no unnecessary CPU load ...)
Sensors
Here we can track the temperatures of different hardware and things related to it:
Since they don't work in the virtual machine, I borrowed them from my server for illustration.
System
And finally, we also look at the system menu, which still has many graphs, some of which are:
Of course, there are plenty of graphs in the system too, all of which would be superfluous to list here.
A next page we continue with the installation, management and use of the Munin plugins.
- http://munin-monitoring.org/
- http://guide.munin-monitoring.org/en/latest/
- https://packages.debian.org/stretch-backports/munin
- https://packages.debian.org/buster/munin
- Server monitoring with Monit on Debian and Ubuntu systems
- How to install Matomo (formerly Piwik) web analytics software on our Apache server
- Perfect server: Debian 9 (stretch) V1.0
- Perfect server: Debian 10 (Buster) V1.0
- Perfect server: Debian 11 (Bullseye) v1.0
- How to build and arming our ISPConfig3 server and how to secure our control panel, main services and websites with Let's Encrypt SSL
Navigation
- To post registration and login required
- 419 views