WWW statistics using python (4/3)

Paul Sijben (sijben@cs.utwente.nl)
Fri, 1 Jul 1994 12:59:21 GMT

PS: I should have mentioned the usage of this script:
Here it comes..

stat.py -h gives:
-----------
Usage: -w|-d [<number>] [-g <pathname>] [-f {<filename>}]
-w : present seven days
-d : one day only
<number> : negative offset; -d 1 means present yesterday's connections
-g : generate WWW pages for the report
-f : input filenames;
when -f is ommitted stdin is used
.gz files are automatically uncpompressed.

The script takes its input from stdin or from a file and outputs the long
report on stdout.
The -g option generates and ouput page with a filename of the form
report.<startday>.<startmonth>.-.<endday>.<endmonth>.<endyear>.html

also an indexfile is generated, containing links to all report files.
(see http://www.pegasus.esprit.ec.org/people/sijben//statistics/index.html)

If the script is run without options it expects it's input from stdin and
makes a only a full report of the enture file.

I use the script like this:
from another script run by cron monday 1:00

PATH=/usr/new:/bin:/etc:/usr/etc:/usr/bin:/usr/ucb:/usr/local/bin/
pad=/usr/local/share/www/WWW/people/sijben/statistics/
#files="/usr/etc/httpd/logs/access_log.1.gz /usr/etc/httpd/logs/access_log.2.gz /usr/etc/httpd/logs/access_log"
files=/usr/etc/httpd/logs/access_log
user=sijben@pegasus.esprit.ec.org
stat.py -w 1 -g $pad -f $files |mail $user

When you want to modify stat.py for usage on your own site you have to change
the services and sservices lists and their usage.
* services if the name under which the service is presented in the reports
* sservices if the string that is searched for in the logfile.
When you check aggregate() you will see that I map '~' onto 'people'. Mind that
the list is searched in the order stated. In this way the services that are
places under a persons private directory is accountd a that service and not as
a reference to personal pages.

And of course you will have to change the references to the image (IMG()) and
the link to my personal page.

I apologise for the usage of some dutch vaiable names. I mostly use them
when I want to avoid clashes with keywords or imported values.

Paul

_______________
Paul Sijben tel.: +31-53-893735 | Zooropa... don't worry baby
University of Twente computer science dep.| It's gonna be alright
e-mail: sijben@pegasus.esprit.ec.org | Zooropa... uncertainty...
For PGP key finger my e-mail address | can be a guiding light