sarg-reports is a bash script written to automate
the SARG (a powerful squid log analyzer) reports and log management.
Sarg it self, provide to end user a generic interface to create
reports based on squid access log (begin of log to current date).
sarg-reports (this script) is useful because it allow you to easly
create and manage Daily, Weekly and Monthly reports.
Try it, within 5 minutes you will be ready to rule :-)
using sarg-reports is very easy, read the following 3 steps to know how
Requirements
a) An unix system with bash shell (like GNU/Linux, FreeBSD, etc...)
b) Squid - http://www.squid-cache.org
c) Sarg - http://web.onda.com.br/orso/sarg.html
Installation guide and configuration parameters
1) Download Squid and Sarg, Install, Configure and Tune
they before continue reading
2) In root crontab (crontab -e) insert the following lines:
(the today report creation time depend mostly of your squid server
load average, tune it):
--- BEGIN ROOT CRONTAB ---
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
00 08-18/1 * * * sarg-reports today
00 00 * * * sarg-reports daily
00 01 * * 1 sarg-reports weekly
30 02 1 * * sarg-reports monthly
--- END ROOT CRONTAB ---
REMEMBER: if you use logrotate, configure it to rotate the logs within MONTHLY basis, AFTER sarg-reports created the monthly html report.
3) Customize the following variables:
(Please, configure accurately the sarg.conf file before)
(SARG) The sarg executable location
(CONFIG) The sarg main configuration file location
(HTMLOUT) Location where will be saved the reports
(PAGETITLE) The title of main index page
(LOGOIMG) Image logo to view in main index page
(LOGOLINK) HTTP web page link of logo
(DAILY) Word 'daily' translation, translate it to your language
(WEEKLY) Word 'weekly' translation, translate it to your language
(MONTHLY) Word 'monthly' translation, translate it to your language
(EXCLUDELOG1) Exclude text from cron emails
+ (normally, sarg, during cron activity, if it don't find any valid records,
(EXCLUDELOG2) it will output an error message (usually on 'today' reports).
I don't want to be warned by email about this, so, i wrote the 'text'
that will be never logged.
This is useful to receive email of real problems only (enjoy that)
Download:
sarg-reports Version 20050202