Sarg – Squid log analyzer

SARG – Squid Analysis Report Generator is a tool that allow you to view “where” your users are going to on the Internet.
Homepage

Instalacija :
# tar xvfz sarg-xxx.tar.gz
# cd sarg-xxx
# ./configure
*********************
Ako se pri ovome, na kraju kompilacije jave greške :
configure: gd.h was not found so the graphs won’t be available in the report
configure: pcre.h was not found so the regexp won’t be available in the hostalias

Rešenje je u navedenim paketima koje treba instalirati :
– libstdc++-devel
– pcre-devel
– gd-devel
*********************
# make
# make install

Konfiguracija :
Konfiguracioni fajl : /usr/local/etc/sarg.conf, koji podešavamo ovako :
access_log /var/log/squid/access.log
date_format e ## since here we use date format DD-MM-YYYY
overwrite_report yes ## because I don’t want multiple sarg reports for the same day
output_dir /var/www/html/squid-reports

Folder za izlazne izveštaje pravimo, sa sledećim pravima :
drwxrwxr-x 2 apache root 4096 May 10 10:40 squid-reports

U fajlu Apache DocumentRoot/sarg-php/sarg-squidguard-block.php podesiti sledeće linije da budu tačne :
$SargConf = “/usr/local/etc/sarg/sarg.conf”;
$squidGuardConf = “/usr/local/squidGuard/squidGuard.conf”;
Podesiti vlasništvo za folder Apache DocumentRoot/sarg-php :
drwxr-xr-x 3 apache root 4096 May 10 10:19 sarg-php

Pri instalaciji se deo sadržaja smešta u Apache DocumentRoot/sarg-php folder.

Sada puštamo Sarg da radi :
# sarg -x
SARG: Init
SARG: Loading configuration from /usr/local/etc/sarg.conf
…..
SARG: Successful report generated on /var/www/html/squid-reports/09May2013-10May2013
SARG: Purging temporary file sarg-general
SARG: End

Posle ovoga se na web adresi http://IP/squid-reports nalaze izveštaji
Da bi Sarg redovno pravio izveštaje stavljamo zapis u cron :
# crontab -e
30 2 * * * sarg

Odličan link za instalaciju.
Dobar link.
Link za forum.

Comments are closed.