# Copyright (c) 2010-2013 IndexData ApS. http://indexdata.com

This package contains statistics tools for pazpar2
http://www.indexdata.com/pazpar2

To get basic help, run
$ cd bin; make help

Cron
------------------------------------------------------
Most of the scripts are started by a cron job

# generate reliablity statistics once at midnight
55 23 * * * /usr/share/pazpar2-statistic/bin/pazpar2-error-statistic

# update realtime reliablity statistics every half hour, and upload it to cfrepo.indexdata.com
0,30 * * * * /usr/share/pazpar2-statistic/bin/pazpar2-error-statistic-realtime; /usr/share/pazpar2-statistic/bin/upload-statistic.sh


The scripts are configurable in

/etc/pazpar2-statistic.rc
PP_STAT_HOSTNAME="ariel.indexdata.com"
CFREPO_AUTH="ariel:ariel"
CFREPO_UPLOAD_URL="https://cfrepo.indexdata.com/upload.pl/1.0"

Files
------------------------------------------------------
The cron jobs will generate CSV statistics files in /var/lib/cf-repo/.statistic

.reliability-today.csv			failures, and total searches
.reliability-week.csv			failures, and total searches

.reliability-today-full-query.csv	chronological, error message, and search query
.reliability-yesterday-full-query.csv	chronological, error message, and search query

these files will be used on cfrepo.indexdata.com to display failure rates
and error messages.

Custom pazpar2 log files
--------------------------------

You can process the pazpar2.log files on a different machine, and upload
the results to the cfrepo site.

use the environment variable "logfile" to specify the pazpar2 log files

E.g.:

cd /usr/share/pazpar2-statistic/bin
logfile="/var/log/pazpar2.log /var/log/pazpar2.log.1 /var/log/pazpar2.log.?.gz" make week-full-query > /tmp/week.csv
curl -fs -u stat:stat36 -H "Expect:" -F "file=@/tmp/week.csv" https://cfrepo.indexdata.com/upload.pl/1.0/ariel.indexdata.com/.reliability-week-full-query.csv

The /upload.pl script takes 3 pathinfo variables, a version number, the
hostname where pazpar2 runs and the filename of the statistics. For valid
statistic file names see above section Files.

Munin plugins
----------------------------------
The package contains munin plugins for pazpar2 for real time
monitoring. Munin is not installed by default. To enable the plugins,
run:

sudo make -C/usr/share/pazpar2-statistic/bin install-munin-plugin

More information about munin: http://munin-monitoring.org/

--
Feb 2013, Wolfram Schneider
