DansGuardian log analyzer

After quite a few unsuccessful triels, I have taken Sarg as the best DG log analyzer. It is usually used to analyze Squid logs, but can also be used for this…..

Necessary configuration :
In main configuration file of DG : /etc/dansguardian/dansguardian.conf change the log type : logfileformat should be “3” DansGuardian than logs in squid log format.
In main configuration file for Sarg : /etc/sarg/sarg.conf set the location of DG log files : /var/log/dansguardian/access.log (at least on my server).
Additional configuration for sarg.conf :
access_log /var/log/dansguardian/access.log
graphs yes
graph_days_bytes_bar_color orange
title “Name of your company”
output_dir /var/www/sarg
user_ip yes
date_format u
index yes
index_tree file
overwrite_report no
topsites_num 100
report_type topusers topsites sites_users users_sites date_time denied auth_failures site_user_time_date downloads
long_url yes
show_successful_message yes
show_read_statistics yes
topuser_fields NUM DATE_TIME USERID CONNECT BYTES %BYTES IN-CACHE-OUT USED_TIME MILISEC %TIME TOTAL AVERAGE
user_report_fields CONNECT BYTES %BYTES IN-CACHE-OUT USED_TIME MILISEC %TIME TOTAL AVERAGE
show_sarg_info no
www_document_root /var/www/

To have Sarg active, and taking DG logs, and making its html page, there is no sense in setting up its files in /etc/cron/daily&weekly. Just put a line in crontab :
# crontab -e
30 2 * * * sarg

This entry was posted in Linux and tagged , , . Bookmark the permalink.

Comments are closed.