Quick sarg configuration check, to make sure you have the right files in the right places:
Make sure sarg is pointed to /var/www/sarg, not /var/www/html/sarg# grep sarg /etc/httpd/conf/httpd.confAlias /squid /var/www/sarg
<Directory /var/www/sarg>
Make sure your daily, weekly & monthly scripts exist# du -a /etc/cron.* | grep sarg4 /etc/cron.daily/sarg
4 /etc/cron.monthly/sarg
4 /etc/cron.weekly/sarg
Do a reality check on one of the scripts - where does it get "sarg"? where does the output go?# cat /etc/cron.daily/sarg#!/bin/bash
#Generate Access.log for correct weekly reports
gunzip -c /var/log/squid/access.log.1.gz > /var/log/squid/access.log.daily > /dev/null 2>&1
cat /var/log/squid/access.log >> /var/log/squid/access.log.daily
/usr/bin/sarg -l /var/log/squid/access.log.daily -o /var/www/sarg/daily -d "$(date --date "1 day ago" +%d/%m/%Y)" > /dev/null 2>&1
exit 0
Check that sarg is in /usr/bin, and find out what version it is# /usr/bin/sarg -h/usr/bin/sarg: Usage [options...]
-a Hostname or IP address
-b Useragent log
-c Exclude file
-d Date from-until dd/mm/yyyy-dd/mm/yyyy
-e Email address to send reports (stdout for console)
-f Config file (/etc/sarg/sarg.conf)
-g Date format [e=Europe -> dd/mm/yy, u=USA -> mm/dd/yy]
-h Help (this...)
-i Reports by user and IP address
-l Input log
-n Resolve IP Address
-o Output dir
-p Use Ip Address instead of userid (reports)
-s Accessed site [Eg.
www.microsoft.com,
www.netscape.com]
-t Time [HH, HH:MM, HH:MM:SS]
-u User
-w Temporary dir
-x Process messages
-z Debug messages
-convert Convert the access.log file to a legible date
-split Split the log file by date in -d parameter
sarg-1.4.1 25Apr2003 by Pedro Lineu Orso - orso@brturbo.com
http://web.onda.com.br/orso/index.htmlCheck your sarg output folder structure# du /var/www/sarg2548 /var/www/sarg/daily/2006Aug21-2006Aug21
2556 /var/www/sarg/daily
4 /var/www/sarg/monthly
4 /var/www/sarg/ONE-SHOT
4 /var/www/sarg/weekly
2576 /var/www/sarg
Run the daily script. You should get NO output on the screen# /etc/cron.daily/sarg#