User:Ckeene
Chris Keene. Technical Development Manager, University of Sussex Library, UK.
Simple statistics
Summary
Provide basic usage statistics, for individual eprints and the whole system. Other tools and systems are available to provide more sophisticated solutions. It has been tested with Eprints 2, some minor modification (especially to the SQL) will be required for Eprints 3.
Before you start
- Find out where your logs are, and if they are being 'rotated'
- Find or create a directory where static html files can be placed and accessible by the web server (we will use /home/eprints/htdocs/stats/)
- Consider setting up Apache to use different log files for different eprint archives, and for non-eprints requests
Installation
- Install analog (http://www.analog.cx). Most linux systems will have a package available for this.
- Download the gzip file containing the config files and perl scripts.
- unpack in to a directory, e.g. /home/eprints/analog/
- Ensure that the two perl scripts and the shell script and executable by you (e.g. chmod 744 *.pl)
- edit 'general.cfg' you will need to:
- Replace the fictional eprints users (foobar and mit.edu) with your own org
BASEURL http://eprints.mit.edu HOSTURL http://eprints.mit.edu HOSTNAME "Foobar Research Online" REFREPEXCLUDE http://eprints.mit.edu/* REFREPEXCLUDE http://eprints.lib.mit.edu/* REFSITEEXCLUDE http://eprints.mit.edu/* REFSITEEXCLUDE http://eprints.lib.mit.edu/* [Further down you may want to also edit the SUBDOMAIN]
- Specify the location of the log file(s)
LOGFILE /usr/local/apache/logs/eprints_log
- You may need to uncomment and set up the DNS cache near the bottom (see http://www.analog.cx for info)
- Edit the other .cfg files to specify the output location for the report and associated chart images
- At this point you can run ./runanalog.sh (or use the commands it contains) for some basic reports.
- Edit generate_aliases.pl and enter your database, username and password. This will change the 'Request report' to show the title of the eprint rather than the (not very useful) filename.
- Edit recordreports.pl - again edit the db, username and password. You may also need to change the file locations in the analog command at the bottom.
- run ./recordreports.pl - this may take a while!
Reports
You should now have five general reports: detailed, simple, full text articles only, records and a final report for the last 30 days. You should also have a directory containing a report for each eprint in your archive.
Things you might want to change
- The names produced by generate_aliases.pl - this perl script makes use of a feature of Analogs to replace a file name with some text. The default text is, for files and metadata records respectively :
[filetype] eprint title [record] eprint title This is quite basic and may not work for all types of archives. However it is quite easy to modify. The core of the file is an SQL statement, then a while loop, which creates a string, makes sure it isn't too long and then adds it to the config file. This is then repeated for the metadata records. It should be simple to add code and modify the strings as you require.