Skip to content

Fetch seedlink data and store them into InfluxDB

Notifications You must be signed in to change notification settings

opmopmopmlee/sl2influxdb

 
 

Repository files navigation

Seedlink to InfluxDB

Dump seedlink (seismological) time series into InfluxDB. Use Grafana to plot waveforms, real time latency delay, etc. Maps uses the grafana worldmap-panel plugin.

Dockerfile, docker-compose.yml are available here.

Install

pip install .

Usage

~$ seedlink2influxdb -help
Usage: seedlink2influxdb [options]

Options:
  -h, --help            show this help message and exit
  --dbserver=DBSERVER   InfluxDB server name
  --dbport=DBPORT       InfluxDB server port
  --slserver=SLSERVER   seedlink server name
  --slport=SLPORT       seedlink server port
  --fdsnserver=FDSN_SERVER[:PORT]
                        fdsn station server name
  --streams=STREAMS     streams to fetch (regexp): [('.*','.*','.*Z','.*')]
  --flushtime=NUMBER    when to force the data flush to influxdb
  --db=DBNAME           InfluxDB name to use
  --dropdb              [WARNING] drop previous database !
  --keep=NUMBER         how many days to keep data
  --recover             use seedlink statefile to save/get streams from last

Example :

seedlink2influxdb
    --dbserver localhost \
    --dbport 8086 \
    --slserver rtserve.resif.fr \
    --fdsnserver http://ws.resif.fr \
    --db eost2 \
    --keep 1

Note

Fdsnserver request (--fdsnserver option) is optional. It is only used and performed at the begining and could be slow (if too much stations info are requested) ! Data collected are only used to get station coordinates and are converted to geohash, needed to plot measurements on a map.

Screenshot

Delay/Latency

Map plugin Geomap plugin

Dealy Latency board

Waveform, RMS, latency plots for a given station

Traces for multiple stations

InfluxDB

InluxDB data representation (measurements, tags, fields, timestamps).

Measurements:

  • queue: internal messages producer queue (seedlink thread) and consumer queue (influxdb exporter thread)
    • tags
      • type=(consumer|producer)
    • field
      • size=queue size
    • timestamp
  • count : amplitude in count (waveforms)
    • tags
      • channel = channel name (eg. FR.WLS.00.HHZ)
    • field
      • value = amplitude
    • timestamp
  • latency : seedlink packet propagation time from station to datacenter
    • tags
      • channel = channel name
    • field
      • value = latency value
    • timestamp
  • delay : time since last seedlink packet was received
    • tags
      • channel = channel name (eg. FR.WLS.00.HHZ)
      • geohash = station coordinates geohash formated
    • field
      • value = latency value
    • timestamp

Dependencies

Using docker

A docker-compose is available to quickly setup influxdb and grafana. Use docker-compose build to make docker images.

Data storage

If you are running this project for the first time, you have to create a influxdb data docker volume in order to keep your measurements between restarts:

docker volume create --name=sl2influxdb_influxdb_data

Start services

For RaspberryShake

This configuration is ready to be run, assuming your raspeberryshake is in you local network and reachable using raspberryshake.local address.

To start all the containers (influxdb, seedlink fetcher and grafana):

docker-compose up -d rshakegrafana

Check the logs to see if seedlink data is fetched without problem:

docker-compose logs -f sl2raspberryshake

For Generic Seedlink Server

You need to customize the docker-compose.yml file to set properly this environement variables:

  • SEEDLINK_SERVER
  • FDSN_WS_STATION_SERVER
  • SEEDLINK_STREAMS (without space !!)

Then, starts the container:

docker-compose up -d sl2generic

To check the logs if seedlink data is fetched well:

docker-compose logs -f sl2generic

Acces to grafana interface

docker-compose up -d grafana

Some time it may be required to wait for grafana to start since some modules will be installed or upgraded. Have a look to the log file using :

docker-compose logs -f grafana

When upgrading grafana (eg: version 5 to 5.1 or later) it may be necessary to remove and create again grafana volumes :

docker volume rm _grafana_volume_name_
docker volume create --name=_grafana_volume_name_

At least removes _grafana_volume_name_, when starting containers docker-compose will tell you which volume is missing and it will give you the command line to create it.

Then launch you preferred browser and go to http://localhost:3000, with:

  • user: admin
  • passwd : admin

Stop services

docker-compose down -v

About

Fetch seedlink data and store them into InfluxDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 93.1%
  • Shell 3.9%
  • Dockerfile 3.0%