Dernièrement j’ai dû procéder à la mise à jour de nos appliances pfSense dans mon entreprise, suite à la réinstallation des paquets à jour j’ai installé SARG et LightSQUID qui m’aident à identifier les consommations de bande passante de notre proxy.
La mise à jour ne permettait d’afficher les rapports d’aucun des deux reporters, j’ai donc dû procédér à plusieurs manipulations afin de récupérer le bon fonctionnement de ces paquets.
SARG
Dans (Status > Sarg Reports > [View Report] Tab) un message d’erreur s’affichait:
Error: Could not find report index file. Check and save sarg settings and try to force sarg schedule.
les rapports squid sont généré par défaut dans /usr/pbi/sarg-amd64/local/sarg-reports/ or sarg s’attend à les trouver dans /usr/local/sarg-reports/ un répertoire existant.
Tout d’abord nous allons selectionner les bonnes options dans l’onglet général de sarg
Puis nous allons modifier les options de schedule pour mettre à jour le fichier toute les heures et supprimer les options additionnelles par défaut (supprimer TODAY: -d `date +%d/%m/%Y`) procédé aux modifications dans l’ordre décris.
Normalement un rapport a été générer dans /usr/pbi/sarg-amd64/local/sarg-reports/
ls /usr/pbi/sarg-amd64/local/sarg-reports/
Nous allons ensuite devoir lier le repertoire /usr/local/sarg-reports/ pour que les rapports s’affiche correctement dans la console SARG
rm -rf /usr/local/sarg-reports/ ln -s /usr/pbi/sarg-amd64/local/sarg-reports /usr/local/sarg-reports
Les rapports doivent être correctement généré dans la vu de la console pfsense.
LIGHTSQUID
Les graphiques ne fonctionnent pas dans la page graph.cgi et renvoi vers une erreur 500.
Après quelques recherches il semblerait que la version de p5-GD soit absente dans la distribution pfsense.
Activation du gestionnaire de paquet FreeBSD
[2.2.5-RELEASE][admin@back-end-pfsense.idea-groupe.com]/: pkg The package management tool is not yet installed on your system. Do you want to fetch and install it now? [y/N]: y Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/freebsd:10:x86:64/latest, please wait... Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done Installing pkg-1.6.2... Extracting pkg-1.6.2: 100% Message from pkg-1.6.2: If you are upgrading from the old package format, first run: # pkg2ng
installation de p5-GD
[2.2.5-RELEASE][admin@back-end-pfsense.idea-groupe.com]/usr/bin: pkg install p5-GD
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
Updating database digests format: 100%
The following 10 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
p5-GD: 2.56_2
perl5: 5.20.3_8
libgd: 2.1.0_7,1
fontconfig: 2.11.1_1,1
expat: 2.1.0_3
freetype2: 2.6_1
png: 1.6.19
tiff: 4.0.6
jbigkit: 2.1_1
jpeg-turbo: 1.4.2
The process will require 60 MiB more space.
16 MiB to be downloaded.
Proceed with this action? [y/N]: y
Fetching p5-GD-2.56_2.txz: 100% 127 KiB 130.1kB/s 00:01
Fetching perl5-5.20.3_8.txz: 100% 13 MiB 13.8MB/s 00:01
Fetching libgd-2.1.0_7,1.txz: 100% 179 KiB 183.3kB/s 00:01
Fetching fontconfig-2.11.1_1,1.txz: 100% 287 KiB 294.1kB/s 00:01
Fetching expat-2.1.0_3.txz: 100% 98 KiB 100.2kB/s 00:01
Fetching freetype2-2.6_1.txz: 100% 466 KiB 476.8kB/s 00:01
Fetching png-1.6.19.txz: 100% 266 KiB 272.3kB/s 00:01
Fetching tiff-4.0.6.txz: 100% 808 KiB 827.5kB/s 00:01
Fetching jbigkit-2.1_1.txz: 100% 66 KiB 67.3kB/s 00:01
Fetching jpeg-turbo-1.4.2.txz: 100% 270 KiB 276.1kB/s 00:01
Checking integrity... done (0 conflicting)
[1/10] Installing expat-2.1.0_3...
[1/10] Extracting expat-2.1.0_3: 100%
[2/10] Installing freetype2-2.6_1...
[2/10] Extracting freetype2-2.6_1: 100%
[3/10] Installing jbigkit-2.1_1...
[3/10] Extracting jbigkit-2.1_1: 100%
[4/10] Installing jpeg-turbo-1.4.2...
[4/10] Extracting jpeg-turbo-1.4.2: 100%
[5/10] Installing fontconfig-2.11.1_1,1...
[5/10] Extracting fontconfig-2.11.1_1,1: 100%
Running fc-cache to build fontconfig cache...
/usr/local/share/fonts: skipping, no such directory
/usr/local/lib/X11/fonts: caching, new cache contents: 0 fonts, 1 dirs
/usr/local/lib/X11/fonts/local: caching, new cache contents: 0 fonts, 0 dirs
/root/.fonts: skipping, no such directory
Re-scanning /usr/local/lib/X11/fonts: caching, new cache contents: 0 fonts, 1 dirs
/var/db/fontconfig: cleaning cache directory
/root/.fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded
[6/10] Installing png-1.6.19...
[6/10] Extracting png-1.6.19: 100%
[7/10] Installing tiff-4.0.6...
[7/10] Extracting tiff-4.0.6: 100%
[8/10] Installing perl5-5.20.3_8...
[8/10] Extracting perl5-5.20.3_8: 100%
makewhatis: not found
makewhatis: not found
pkg: POST-INSTALL script failed
[9/10] Installing libgd-2.1.0_7,1...
[9/10] Extracting libgd-2.1.0_7,1: 100%
[10/10] Installing p5-GD-2.56_2...
[10/10] Extracting p5-GD-2.56_2: 100%
Message from perl5-5.20.3_8:
The /usr/bin/perl symlink has been removed starting with Perl 5.20.
For shebangs, you should either use:
#!/usr/local/bin/perl
or
#!/usr/bin/env perl
The first one will only work if you have a /usr/local/bin/perl,
the second will work as long as perl is in PATH.
[2.2.5-RELEASE][admin@back-end-pfsense.idea-groupe.com]/usr/bin: /usr/bin/perl -v
This is perl 5, version 20, subversion 3 (v5.20.3) built for amd64-freebsd-thread-multi
Copyright 1987-2015, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
Modification du fichier de configuration de lightsquid pour augmentation de l’échelle des ordonnées, dans /usr/pbi/lightsquid-amd64/local/etc/lightsquid/lightsquid.cfg
$graphmaxall =4.40*(1024*1024*1024);
Et voila des graphiques tout beau 🙂

