Introduction
============

L&B Harvester gathers information about jobs from L&B servers using effective
L&B notification mechanism. It manages notifications and keeps them in
a persistent storage (file or database table) to reuse later on next launch.
It takes care about refreshing notifications and queries L&B servers back when
some notification on expires.

The tool was initially written for Real Time Monitor (project at Imperial
College in London), later was extended with messaging mechanism for WLCG.


Requirements
============

Configuration on L&B servers:
- lastUpdateTime index
- harvester identity in super users file

Or the yaim parameters in site-info.def:
  GLITE_LB_RTM_ENABLED=true
  GLITE_LB_RTM_DN="certificate subject"

See also L&B Admin Guide.

Launch (with msg-publish sending messages)
=========================================

Harvester is sending notifications via msg-publish infrastructure. List of the
L&B server to harvest is specified via -c option.

1) with newer LB 2.0 servers:

  glite-lb-harvester -c servers.txt -C certfile -K keyfile --wlcg

2) with older LB servers (backward compatible but greedy notifications):

  glite-lb-harvester -c servers.txt -C certfile -K keyfile --wlcg --old

Custom configuration of messaging:
	--wlcg-binary $HOME/bin/msg-publish
	--wlcg-topic org.wlcg.usage.JobStatus2
	--wlcg-config $HOME/etc/msg-publish.conf.wlcg


Launch (Real Time Monitor and storing to the database)
======================================================

Harvester is using postgres database. Table 'lb20' with L&B servers to
harvest (read-only), table 'jobs' with result job states (read/write). It's
possible to specify L&B servers list by file instead of 'lb20' table,
via -c option.

  glite-lb-harvester -C certfile -K keyfile --pg rtm/@:rtm

The connection string after '--pg' is in format:
  USER/PASSWORD@HOST:DATABASE
Database schema in 'test.sql'.


Other recommended options
=========================

Use 'glite-lb-harvester --help' for additional options.

For example:
 - deamonizing and using syslog:
	'--daemonize --pidfile /var/run/glite-lb-harvester.pid'
 - decreasing verbosity:
	'-d 2' (2 for errors and warnings only)


Stop
====

In non-daemon mode CTRL-C can be used, in daemon mode using specified
pidfile:

 kill `cat /var/run/glite-lb-harvester.pid`

pidfile will vanish after exit.

All notifications are preserved on LB servers, and will expire later. You can
purge them now, if they won't be needed:

 glite-lb-harvester --cleanup
