Author Topic: SARG doesn't create reports [RESOLVED]  (Read 12112 times)

kalganum

  • Zen Apprentice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
SARG doesn't create reports [RESOLVED]
« on: August 06, 2010, 12:19:43 pm »
Hi there,

I have installed the last eBox 1.4 available recently. I have set up a transparent proxy, webmin and SARG 2.5.2

1) In Webmin I can setup regular squid-reports or make instant squid-reports which are stored in my www/squid-reports directory but never in daily, weekly or monthly folder (that are not created anyway); I thought it could be a webmin issue...

2) I had stop using webmin scheduler for reports and update crontab -e with the following code:
Code: [Select]
00 08-18/1 * * * sarg-reports today
00 00 * * * sarg-reports daily
00 01 * * 1 sarg-reports weekly
30 02 1 * * sarg-reports monthly
If I try to start sarg like this: #sarg -x
There is generation of a squid-reports with a correct index file in www/squid-reports folder
If I try #etc/cron/cron.daily
Sarg return an error message like: sarg can not find log file
resulting in no report.!!

I don't know where to look so fix this issue. Any help is welcome.!
Thanks

Kal

« Last Edit: August 19, 2010, 02:13:49 pm by kalganum »

jquintao

  • Board Moderator
  • Zen Hero
  • *****
  • Posts: 648
  • Karma: +14/-0
  • jquintao
    • View Profile
    • NetSol
Re: SARG doesn't create reports
« Reply #1 on: August 11, 2010, 02:49:41 am »
Hi Kal,

Try create a script called "/root/generate_sarg" with:

Code: [Select]
#!/bin/bash

INICIO=$(date --date "31 days ago" +%d/%m/%Y)
FIM=$(date --date "0 day ago " +%d/%m/%Y)
sarg -f /etc/squid/sarg.conf -d $INICIO-$FIM -i -x -z

And put in the file "/etc/crontab" the following:

Code: [Select]
15 1 * * * root /root/generate_sarg

Maybe you need adapt the "/root/generate_sarg"...

Thanks,
Jorge Quintao

kalganum

  • Zen Apprentice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: SARG doesn't create reports [RESOLVED]
« Reply #2 on: August 19, 2010, 02:14:37 pm »
Thanks,

In fact it was a problem of logrotate setting for Squid.
I have changed it to weekly and now it is working fine.

Regards

Kal