Inventory database synchronisation.
scinv merges inventory XML files to a single inventory, synchronises an inventory with another (most common use is with database), creates initial key files and much more ...
scinv is used by etc/init/scinv.py to synchronise the inventory from etc/inventory with the database.
seiscomp update-config inventory
scinv works with different commands. The command must be given as 1st parameter to the application. All others parameters must follow.
scinv $command [options] [files]
Synchronises an applications inventory with a given source given as file(s). The applications inventory is either read from the database or given with --inventory-db. As a result all information in the source is written to target and target does not contain any additional information. The source must hold all information. This works different to merge. If an output file is specified with -o no notifiers are generated and sent via messaging.
This command is used by etc/init/scinv.py as follows:
scinv sync --console=1 -H localhost:$p --filebase "$fb" \
--rc-dir "$rc" --key-dir "$kd"
where
$p = configured messaging port
$fb = $SEISCOMP_ROOT/etc/inventory
$rc = $SEISCOMP_ROOT/var/lib/rc
$kd = $SEISCOMP_ROOT/etc/key
Merges two or more inventories into one inventory. This command is useful to merge existing subtrees into a final inventory before synchronization.
scinv merge net1.xml net2.xml -o inv.xml
Applies stored notifiers created with sync and option --create-notifer which is saved in a file (-o). Source is the applications inventory read from the database or given with --inventory-db. If -o is passed no messages are sent but the result is stored in a file. Useful to test/debug or prepare an inventory for offline processing.
# Synchronise inventory and save the notifiers locally (no messages
# are sent)
scinv sync -d mysql://sysop:sysop@localhost/seiscomp3 \
--create-notifier -o sync_patch.xml
# Sent the notifiers to the target system
scinv apply -H localhost sync_patch.xml
This operation can be useful to save synchronisation diffs for validation or to debug problems.
Synchronise station key files with current inventory pool. This command merges all XML files in the inventory pool (or the given files) and checks if a corresponding station key file in etc/key exists. If not an empty station key file is created. If a station key file without a corresponding station in the merged inventory is found, it is deleted.
List contained items up to channel level. This command is useful to inspect an XML file or the complete inventory pool.
$ scinv ls SK.KOLS.xml
network SK Slovak National Network of Seismic Stations
epoch 1980-01-01
station KOLS Kolonicke sedlo, Slovakia
epoch 2004-09-01
location __
epoch 2004-09-01
channel BHE
epoch 2006-04-25 12:00:00 - 2010-03-24
channel BHN
epoch 2006-04-25 12:00:00 - 2010-03-24
channel BHZ
epoch 2006-04-25 12:00:00 - 2010-03-24
channel EHE
epoch 2004-09-01 - 2006-04-25 10:00:00
channel EHN
epoch 2004-09-01 - 2006-04-25 10:00:00
channel EHZ
epoch 2004-09-01 - 2006-04-25 10:00:00
channel HHE
epoch 2006-04-25 12:00:00 - 2010-03-24
channel HHE
epoch 2010-03-25
channel HHN
epoch 2006-04-25 12:00:00 - 2010-03-24
channel HHN
epoch 2010-03-25
channel HHZ
epoch 2006-04-25 12:00:00 - 2010-03-24
channel HHZ
epoch 2010-03-25
The default level of information printed is chan. Available levels are net, sta, chan and resp.
To check the available networks and stations in the inventory pool, calling
scinv ls
is enough.
scinv inherits global options.
scinv command [options] [files]
Command is one of: sync, merge, apply, keys and ls.
show help message.
show version information
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.
Load given plugins.
Run as daemon. This means the application will fork itself and doesn't need to be started with &.
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).
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.
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 level [0..4]. 0:quiet, 1:error, 2:warning, 3:info, 4:debug
Increase verbosity level (may be repeated, eg. -vv)
Quiet mode: no logging output
Limits the logging to a certain component. This option can be given more than once.
Use syslog logging back end. The output usually goes to /var/lib/messages.
Path to lock file.
Send log output to stdout.
Debug mode: --verbosity=4 --console=1
Use alternative log file.
Overrides configuration parameter connection.username.
Overrides configuration parameter connection.server.
Overrides configuration parameter connection.timeout.
Overrides configuration parameter connection.primaryGroup.
A group to subscribe to. This option can be given more than once.
Overrides configuration parameter connection.encoding.
Sets sending of a start- and a stop message.
List all supported database drivers.
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".
The configmodule to use.
Load the inventory database from a given XML file.
Do not use the database at all
Filebase to check for XML files. If not given, all XML files passed are checked.
If given, rc (ressource) files will be created in this directory for each station. The stations desciption will be from the last available epoch.
If given this directory is used to synchronise key files.
Output file.
Information level (net, sta, cha or resp) used by ls.