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

[cobalt-users] [RAQ3] Statistics



Hello,

I've been following the thread on RaQ Stats and decided to post our solution
to the list for free. We've been using this little, but powerful, script
that I wrote for over 2 years now (first on the RaQ2's then updated to run
on the RaQ3's).

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). It totals email usage, but
doesn't split it up by domain (we haven't yet found a way to do it from
maillog yet). There's a sample of the email sent at the end of this message.

Note: This is provided as-is with no warranty of suitability or accuracy,
and we don't provide free support for it :-) You're free to use at entirely
your own risk - not that it does anything intrusive anyway.

You can view/download the script at:
http://www.waytotheweb.com/freescripts/statsnow.txt

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.

The email sent is below my sig. Note: this is using sample data, all =
ftp+www traffic.

Regards,
Jonathan Michaelson

Way to the Web Ltd
Web Hosting, E-Commerce and CGI Scripting
http://www.waytotheweb.com

From: sales@xxxxxxxxxxxxxxx
Sent: Wednesday, 14 June 2000 03:06
To: Sales - Way to the Web
Subject: Statistics

First www date processed = 01-Jun-2000
First ftp date processed = 01-Jun-2000
First mail date processed = 01-Jun-2000

###########################################################################

[Jun] all for http://www.chirpy.com = 732.51(mb)
[Jun] all for http://www.webnow2000.com = 202.11(mb)
[Jun] all for http://www.waytotheweb.com = 116.02(mb)
[Jun] all for http://www.mailnow.co.uk = 81.46(mb)
[Jun] all for http://secure.ukwebs.com = 7.34(mb)
[Jun] all for http://www.webs2k.com = 3.71(mb)
[Jun] all for http://www.domainwebs.co.uk = 0.55(mb)
[Jun] all for http://www.ukwebs.com = 0.48(mb)

###########################################################################

[Jun] www for http://www.chirpy.com = 732.50(mb)
[Jun] www for http://www.webnow2000.com = 202.11(mb)
[Jun] www for http://www.waytotheweb.com = 115.71(mb)
[Jun] www for http://www.mailnow.co.uk = 81.46(mb)
[Jun] www for http://secure.ukwebs.com = 7.34(mb)
[Jun] www for http://www.webs2k.com = 2.70(mb)
[Jun] www for http://www.domainwebs.co.uk = 0.55(mb)
[Jun] www for http://www.ukwebs.com = 0.48(mb)

###########################################################################

[Jun] ftp for http://www.webs2k.com = 1.01(mb)
[Jun] ftp for http://www.waytotheweb.com = 0.30(mb)
[Jun] ftp for http://www.chirpy.com = 0.01(mb)

###########################################################################

[Jun] www for all = 1142.85(mb)
[Jun] ftp for all = 1.32(mb)
[Jun] mail for all = 8.51(mb)

###########################################################################

[Jun] Grand Total = 1152.68(mb)