SeisComP3

Table Of Contents

Previous topic

scdb

Next topic

scevtlog

This Page

scdispatch

Reads objects (event, origin, etc) from a SC3ML file and sends the objects to the messaging system.

Description

Examples

  1. Send all objects from a SC3ML file. The default behavior is to add:

    scdispatch -i test.xml
    
  2. Send an update:

    scdispatch -i test.xml -O update
    
  3. Remove the objects:

    scdispatch -i test.xml -O remove
    
  4. Subsets of SC3ML Objects

    It can be useful to import a subset of QuakeML objects, e.g. Origins from other agencies and then allow scevent to associate them to existing events (and possibly prefer them based on the rules in scevent) or create new events for the origins. If the event objects from a SC3ML file are not required to be sent to the messaging then either they should be removed (e.g. using XSLT) and all the remaining objects in the file added:

    scdispatch -i test.xml
    

    or the event objects can be left out of the routing table, e.g.

    scdispatch -i test.xml \
               --routingtable Pick:PICK, \
                              Arrival:ARRIVAL,Amplitude:AMPLITUDE, \
                              Origin:LOCATION,StationMagnitude:MAGNITUDE, \
                              StationMagnitudeContribution:MAGNITUDE, \
                              Magnitude:MAGNITUDE
    

    Note

    The routing table approach is slower, scdispatch still has to try to send to the invalid group for each object. It seems that it should be possible to route to Event:NULL or some other non used group but this seems to always result in another Event (the one in the source SC3ML) being sent and loaded. Is this a bug?

  5. Testing

    For testing it is useful to watch the results of dispatch with scolv or scxmldump. It is also useful to clean the database and logs to remove objects from persistent storage to allow repeated reloading of a file.

    Note

    The following will clear all events from the database and any other other object persistence. Modify the mysql command to suit your db setup.

    mysql -u root --password='my$q1' -e "DROP DATABASE IF EXISTS seiscomp3; \
      CREATE DATABASE seiscomp3 CHARACTER SET utf8 COLLATE utf8_bin; \
      GRANT ALL ON seiscomp3.* TO 'sysop'@'localhost' IDENTIFIED BY 'sysop'; \
      USE seiscomp3;source seiscomp3/trunk/share/db/mysql.sql;"
    
    seiscomp start
    

Configuration

etc/defaults/global.cfg
etc/defaults/scdispatch.cfg
etc/global.cfg
etc/scdispatch.cfg
~/.seiscomp3/global.cfg
~/.seiscomp3/scdispatch.cfg

scdispatch inherits global options.

Command-line

Generic

-h, --help

show help message.

-V, --version

show version information

--config-file arg

Use alternative configuration file. When this option is used the loading of all stages is disabled. Only the given configuration file is parsed and used. To use another name for the configuration create a symbolic link of the application or copy it, eg scautopick -> scautopick2.

--plugins arg

Load given plugins.

-D, --daemon

Run as daemon. This means the application will fork itself and doesn't need to be started with &.

--auto-shutdown arg

Enable/disable self-shutdown because a master module shutdown. This only works when messaging is enabled and the master module sends a shutdown message (enabled with --start-stop-msg for the master module).

--shutdown-master-module arg

Sets the name of the master-module used for auto-shutdown. This is the application name of the module actually started. If symlinks are used then it is the name of the symlinked application.

--shutdown-master-username arg

Sets the name of the master-username of the messaging used for auto-shutdown. If "shutdown-master-module" is given as well this parameter is ignored.

Verbosity

--verbosity arg

Verbosity level [0..4]. 0:quiet, 1:error, 2:warning, 3:info, 4:debug

-v, --v

Increase verbosity level (may be repeated, eg. -vv)

-q, --quiet

Quiet mode: no logging output

--component arg

Limits the logging to a certain component. This option can be given more than once.

-s, --syslog

Use syslog logging back end. The output usually goes to /var/lib/messages.

-l, --lockfile arg

Path to lock file.

--console arg

Send log output to stdout.

--debug

Debug mode: --verbosity=4 --console=1

--log-file arg

Use alternative log file.

Messaging

-u, --user arg

Overrides configuration parameter connection.username.

-H, --host arg

Overrides configuration parameter connection.server.

-t, --timeout arg

Overrides configuration parameter connection.timeout.

-g, --primary-group arg

Overrides configuration parameter connection.primaryGroup.

-S, --subscribe-group arg

A group to subscribe to. This option can be given more than once.

--encoding arg

Overrides configuration parameter connection.encoding.

--start-stop-msg arg

Sets sending of a start- and a stop message.

Database

--db-driver-list

List all supported database drivers.

-d, --database arg

The database connection string, format: service://user:pwd@host/database. "service" is the name of the database driver which can be queried with "--db-driver-list".

--config-module arg

The configmodule to use.

--inventory-db arg

Load the inventory database from a given XML file.

--db-disable

Do not use the database at all

Dispatch

-i, --input flag

File to dispatch to messaging.

-O, --operation flag

Notifier operation to use if not given: add, update or remove. If the XML contains notifier objects then this operation is used. If just plain objects are given, the operation needs to be specified. The default is "add".

--routingtable flag

Specify routing table as comma separated list of object:group pairs, e.g. "Origin:LOCATION,Arrival:ARRIVAL".

--print-objects

Print names of routable objects.

--test

Test mode. Does not send any object.