[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] [RAQ3] Statistics



Jonathan,

> It's designed to be run daily against the RaQ3 /home/log/httpd/access
> combined-access log file and the /var/log/xferlog file sending an email to
> the specified email address. It collates www and ftp traffic for each
domain
> and lists it in reverse MB usage (largest first).

Looks very good.......

> You will need to rename the script to statsnow.pl and chmod 755 it, then
> enter a CRON job to run it sometime after midnight. Since it uses the log
> file, we modify our /etc/logrotate.d jobs to NOT rotate on logfile size,
but
> to do so purely on a monthly basis. If you don't do this it'll keep
> resetting (be very much aware of this if using other products already
> mentioned!). You will also want to disable the rotating of log files after
a
> reboot in the /etc/logrotate.onboot files.

That is huge problem cause if you have a few medium sites or serve a lot of
requests (banners, for instance) your log-files will become huuuuuuugee.

But I think I have a solution. I quote again:

> You will need to rename the script to statsnow.pl and chmod 755 it, then
> enter a CRON job to run it sometime after midnight. Since it uses the log
> file, we modify our /etc/logrotate.d jobs to NOT rotate on logfile size,
but

Please note this only applies to the RaQ2. I don't know in how far the RaQ3
is different.
I know for sure the /home/log/httpd/access is being rotated four times a day
(check /etc/cron.quarter-daily -- you will see a symbolic link to
splitlogs.pl there). Now if you leave your logrotation as it is and run your
script *everytime* before splitlogs.pl splits up the main-log to the
different sites you can have both statistics and your logs rotated. Just
make sure that you create a symbolic link in the /etc/cron.quarter-daily
directory pointing to the statsnow.pl file somewhere on your server. Also
make sure you name it "astatsnow.pl" or whatever so that it gets executed
before splitlogs.pl comes to action.

There migh also be some issues with permissions so check that as well.

I hope this helps.

--fathi