Monitorez votre Debian avec Munin

Plus complet que Linux-Dash je vous propose Munin, un outil pour monitorer votre serveur dédié.

Prérequis: un environnement LAMP

On commence par installer les dépendances:

sudo apt install apache2 apache2-utils libcgi-fast-perl libapache2-mod-fcgid munin munin-node munin-plugins-extra

On active le module fcgid d’apache:

sudo a2enmod fcgid

On sécurise l’accès à Munin:

ATTENTION: Prenez bien soin et remplacer $USERNAME par votre propre utilisateur.
sudo htpasswd -c /etc/munin/munin-htpasswd $USERNAME

Éditez votre configuration Apache:

sudo nano /etc/apache2/sites-available/$NomDeDomaine.conf

Et collez:

        Alias /munin /var/cache/munin/www
                <Directory /var/cache/munin/www>
                        AuthUserFile /etc/munin/munin-htpasswd
                        Authtype Basic
                        AuthName "Munin"
                        Require valid-user
                        Options FollowSymLinks SymLinksIfOwnerMatch
                        Options None
                </Directory>

        ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
                <Location /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>
                </Location>

Activez Munin:

sudo systemctl reload apache2
sudo systemctl restart apache2 munin-node

Il n’y a plus qu’a vous rendre sur http://$IPduServeur/munin ou http://$NomDeDomaine/munin