Name mergeHosts


Synopsis

perl mergeHosts.pl testResults [databaseFile] [tag[=<value>]


Description

MergeHosts.pl is a tool which reads the statProxy test result format from testResults and merges that information into the databaseFile (usually a user configuration xml file). If databaseFile is not present, the data is merged into the hosts.xml database. Existing hosts in the data file are updated, new hosts are added, some hosts may be disabled. Specifying databaseFile allows users to add their own proxy test results to their own configuration files (so there's no need to reenter this data after each update of hosts.xml/zip, or each update of the distribution config files). This mechanism also permits users to keep their proxies confidential.

The tag allows the user to add a new tag to every host merged into the destination database. This is mainly for use by the maintainer of the hosts.xml database, and for users who wish to disable many of the hosts.xml proxies via their user configuration (using 'isEnabled=0').


Options

testResults
An input stream containing the results of tests done on a set of proxies, in statProxy output format, which are to be merged into the main hosts.xml database. A '-' reads test results from STDIN (probably piped from statProxy).

databaseFile
An XML file containing the test data from previous tests. The main database file (and default file here) is hosts.xml (hosts.zip in the distribution and CVS).

tag
A new tag which will be added to every proxy the merge updates/adds/disables. This tag will be given the value 1 (true), unless a value has been specified.


Examples

Merge the users 'secret' proxy test results (in sp.out) into the copy he has made for his own use, of the KSA-Najil configuration (config-me.xml):
perl mergeHosts.pl sp.out config-me.xml

Pipeline the tests and the merge above (secret proxies are in the file secret.txt):
perl statProxy.pl -t all -l secret.txt | perl mergeHosts.pl - config-me.xml


See also

statProxy, extractHosts, cleanHosts
statProxy
extractHosts
cleanHosts