sarg-reports1
Daily/weekly/monthly squid usage reports creation tool
Usage
sarg-reports [OPTIONS]
Overview
This manual page documents briefly the sarg-reports command.
sarg-reports is a script written to automate the SARG (a powerful squid log analyzer) reports and log management. Sarg itself, provide to end user a generic interface to create reports based on squid access log (begin of log to current date). sarg-reports is useful because it allow you to easly create and manage Daily, Weekly and Monthly reports.
Options
A summary of options is included below.
|
Create Manual report |
|---|---|
|
Create Today report |
|
Create Daily report |
|
Create Weely report |
|
Create Monthly report |
Crontab
If you want the reports can be generated automatically insert the following lines (the today report creation time depend mostly of your sarg server load average, tune it):
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
00 08-18/1 * * * sarg-reports today
00 00 * * * sarg-reports daily
00 01 * * 1 sarg-reports weekly
30 02 1 * * sarg-reports monthly
REMEMBER: if you use logrotate, configure it to retain enough logs to ensure availability of data for the longest period for which you need a report. Log rotation frequency is unimportant. See https://sourceforge.net/p/sarg/wiki/Keeping%20enough%20log%20to%20process/ This version of sarg-reports will use the log file defined in sarg.conf and also prior log files which have been rotated out of that location.
Variables
Check before using the sarg-reports that the following variables are set to file /etc/sarg/sarg-reports.conf
- SARG
-
The sarg executable location
- CONFIG
-
The sarg main configuration file location
- HTMLOUT
-
Location where will be saved the reports
- LASTLOGDAILY
-
Set the number of previous daily/today/manual reports to keep
- LASTLOGWEEKLY
-
Set the number of previous weekly reports to keep
- LASTLOGMONTHLY
-
Set the number of previous monthly reports to keep
- 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.
EXCLUDELOG3-
This is debian-specific and used to filter the covered period message
Releases
6 releases since Debian 5.0 (Lenny); the text changed 2 times.