Monitoring the server with Munin in Debian 10
The following guide describes how to install the Munin monitoring software from a Debian system 10.
Thanks to it, we will be able to monitor our server and its many parameters.
We start the terminal and update the repositories and the system:
1 2 | apt update apt upgrade |
We install a web server so that we can get to the graphic part of the interface through the website:
1 | apt install apache2 libcgi-fast-perl libapache2-mod-fcgid |
We run the apache modules:
1 | a2enmod fcgid |
We install Munin:
1 | apt install munin munin-node munin-plugins-extra |
We go to the directory with plugins and run some of the necessary ones:
1 | cd /etc/munin/plugins |
1 2 3 4 5 6 7 | ln -s /usr/share/munin/plugins/mysql_ mysql_ ln -s /usr/share/munin/plugins/mysql_bytes mysql_bytes ln -s /usr/share/munin/plugins/mysql_innodb mysql_innodb ln -s /usr/share/munin/plugins/mysql_isam_space_ mysql_isam_space_ ln -s /usr/share/munin/plugins/mysql_queries mysql_queries ln -s /usr/share/munin/plugins/mysql_slowqueries mysql_slowqueries ln -s /usr/share/munin/plugins/mysql_threads mysql_threads |
The next step is to edit the Munin configuration file.
edit file:
1 | nano /etc/munin/munin.conf |
And we configure it as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | # Example configuration file for Munin, generated by 'make build' # The next three variables specifies where the location of the RRD # databases, the HTML output, logs and the lock/pid files. They all # must be writable by the user running munin-cron. They are all # defaulted to the values you see here. # dbdir /var/lib/munin htmldir /var/cache/munin/www logdir /var/log/munin rundir /var/run/munin # Where to look for the HTML templates # tmpldir /etc/munin/templates # Where to look for the static www files # #staticdir /etc/munin/static # temporary cgi files are here. note that it has to be writable by # the cgi user (usually nobody or httpd). # # cgitmpdir /var/lib/munin/cgi-tmp # (Exactly one) directory to include all files from. includedir /etc/munin/munin-conf.d [...] # a simple host tree [server1.example.com] address 127.0.0.1 use_node_name yes [...] |
Now we create vhost munina
1 | cd /etc/apache2/conf-enabled/ |
1 | ln -s /etc/munin/apache24.conf munin.conf |
1 | service apache2 restart |
edit file:
1 | nano /etc/munin/apache24.conf |
It should look like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | Alias /munin /var/cache/munin/www <Directory /var/cache/munin/www> # Require local Require all granted Options FollowSymLinks SymLinksIfOwnerMatch </Directory> ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph <Location /munin-cgi/munin-cgi-graph> # Require local Require all granted Options FollowSymLinks SymLinksIfOwnerMatch <IfModule mod_fcgid.c> SetHandler fcgid-script </IfModule> <IfModule !mod_fcgid.c> SetHandler cgi-script </IfModule> </Location> |
We are restarting Apache and Munin to reload the changes:
1 | systemctl restart apache2.service |
1 | systemctl restart munin-node.service |
That's practically it, after going to :
our address // munin / we should see the monitoring statistics page.