From 18b65362d8633ba440267cf55ad298d35c690ff7 Mon Sep 17 00:00:00 2001 From: abenmiloud Date: Fri, 15 Oct 2021 11:26:38 +0200 Subject: [PATCH] =?UTF-8?q?Mettre=20=C3=A0=20jour=20proc=C3=A9dure=20pour?= =?UTF-8?q?=20configurer=20zoom=20munin=20avec=20nginx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HowtoMunin.md | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/HowtoMunin.md b/HowtoMunin.md index 0ccb7ce2..85481436 100644 --- a/HowtoMunin.md +++ b/HowtoMunin.md @@ -100,9 +100,9 @@ Pour que cela fonctionne il faut faire tourner un démon FastCGI et le script mu Adapter les droits de `/var/log/munin/munin-cgi` : -~~~ -# chown www-data:munin /var/log/munin/munin-cgi-* -# chmod 660 /var/log/munin/munin-cgi-* +~~~ { .bash } +chown www-data:munin /var/log/munin/munin-cgi-* +chmod 660 /var/log/munin/munin-cgi-* ~~~ De même pour `/etc/logrotate.d/munin`, section `/var/log/munin/munin-cgi-graph.log` : @@ -111,20 +111,16 @@ De même pour `/etc/logrotate.d/munin`, section `/var/log/munin/munin-cgi-graph. create 660 www-data munin ~~~ -Démarrer le démon FastCGI avec `spawn-fcgi` (`apt install libcgi-fast-perl spawn-fcgi`) : +Installer les dépendances pour démarrer le démon : -~~~ -spawn-fcgi -s /var/run/munin/spawn-fcgi-munin-graph.sock -U www-data -u munin -g munin /usr/lib/munin/cgi/munin-cgi-graph +~~~ { .bash } +apt install libcgi-fast-perl spawn-fcgi ~~~ -Si spawn-fcgi ne démarre pas mais renvoie `spawn-fcgi: child exited with: 2`, il se peut que ce soit car le paquet **libcgi-fast-perl** manque +Créer une unité systemd pour gérer le démon : - -On le mettra dans `/etc/rc.local` pour le lancer au démarrage de la machine (un script d'init bien fait est disponible sur - -En Debian 8 on pourra créer une unité systemd : - -~~~{.ini} +~~~ { .bash } +tee > /etc/systemd/system/spawn-fcgi-munin-graph.service << 'eof' [Unit] Description=Munin zoom for nginx. After=network.target @@ -135,8 +131,19 @@ Type=forking [Install] WantedBy=default.target +eof +systemctl daemon-reload +systemctl start spawn-fcgi-munin-graph ~~~ +Pour vérifier si le démon tourne : + +~~~ { .bash } +systemctl status spawn-fcgi-munin-graph +lsof /var/run/munin/spawn-fcgi-munin-graph.sock +~~~ + +> Si spawn-fcgi ne démarre pas mais renvoie `spawn-fcgi: child exited with: 2`, il se peut que ce soit car le paquet `libcgi-fast-perl` manque. Enfin dans le vhost concerné d'Nginx, ajoutez-ceci :