User:Ckeene

From EPrints Documentation
Revision as of 14:21, 5 June 2007 by Ckeene (talk | contribs)
Jump to: navigation, search

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

  1. Install analog (http://www.analog.cx). Most linux systems will have a package available for this.
  2. Download the gzip file containing the config files and perl scripts.
  3. unpack in to a directory, e.g. /home/eprints/analog/
  4. Ensure that the two perl scripts and the shell script and executable by you (e.g. chmod 744 *.pl)
  5. edit 'general.cfg' you will need to:
    1. 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]
    1. Specify the location of the log file(s)
LOGFILE /usr/local/apache/logs/eprints_log
    1. You may need to uncomment and set up the DNS cache near the bottom (see http://www.analog.cx for info)
  1. Edit the other .cfg files to specify the output location for the report and associated chart images
  2. At this point you can run ./runanalog.sh (or use the commands it contains) for some basic reports.
  3. 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.
  4. 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.
  5. 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.