Quote:
Originally Posted by nesargha
hi guys,
but how to configure SARG to get
1)weekly report
2) get list of all sites visited by each user
also SARG is not generating the html reports. how to get both ie. send the report to admin mail id and at the same time generate html reports.
thanks in advance
|
the rpm that was avail for FC4 creates cron jobs for each of the daily, weekly, month... it'll also create the /var/www/sarg dir structure for you and add the appropriate http conf file... the reports will show you what you want.
if you can make sense of this spec file, it'll show you what the rpm does when it installs:
www mack ro/linux/sarg/sarg-2.1.spec
here's an example of a daily cron job:
Code:
#!/bin/bash
exec /usr/bin/sarg \
-o /var/www/sarg/daily \
-d "$(date --date "1 day ago" +%d/%m/%Y)" > /dev/null 2>&1
exit 0
and here's an example of a weekly:
Code:
#!/bin/bash
LOG_FILES=
if [[ -s /var/log/squid/access.log.1.gz ]]; then
LOG_FILES="$LOG_FILES -l /var/log/squid/access.log.1.gz"
fi
if [[ -s /var/log/squid/access.log ]]; then
LOG_FILES="$LOG_FILES -l /var/log/squid/access.log"
fi
# Get yesterday's date
YESTERDAY=$(date --date "1 days ago" +%d/%m/%Y)
# Get one week ago date
WEEKAGO=$(date --date "7 days ago" +%d/%m/%Y)
exec /usr/bin/sarg \
$LOG_FILES \
-o /var/www/sarg/weekly \
-d $WEEKAGO-$YESTERDAY > /dev/null 2>&1
exit 0