Monitorowanie serwera za pomocą Munin w Debianie 10

Poniższy poradnik opisuje sposób instalacji Softu do monitoringu Munin z systemie Debian 10.
Dzięki niemu będziemy mogli monitorować nasz serwer i jego wiele parametrów.

Uruchamiamy terminal i dokonujemy aktualizacji repozytoriów oraz systemu:

apt update apt upgrade

Instalujemy serwer www abyśmy mogli przez stronę dostać się do graficznej części interfejsu:

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

Uruchamiamy moduły apache:

a2enmod fcgid

Dokonujemy instalacji Munin:

apt install munin munin-node munin-plugins-extra

Przechodzimy do katalogu z pluginami i uruchamiamy jedne z niezbędnych:

cd /etc/munin/plugins

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

Kolejny krok to edycja pliku konfiguracyjnego Munina.

Edytujemy plik:

nano /etc/munin/munin.conf

I konfigurujemy go w następujący sposób:

# 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 [...]

Teraz tworzymy vhost munina

cd /etc/apache2/conf-enabled/

ln -s /etc/munin/apache24.conf munin.conf

service apache2 restart

edytujemy plik:

nano /etc/munin/apache24.conf

Powinien wyglądać on w następujący sposób:

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>

Restartujemy Apache oraz Munin w Celu przeładowania zmian:

systemctl restart apache2.service

systemctl restart munin-node.service

To już praktycznie wszystko, po przejściu do :

naszadresip//munin/ powinniśmy zobaczyć stronę ze statystykami monitoringu.

Dodaj komentarz