Compare commits

..

No commits in common. "206af05f2606c0178a3702536a3275b1869169a0" and "4e25190fbc2449a4afd23918f61e3afc63d108ff" have entirely different histories.

4 changed files with 13 additions and 33 deletions

4
.gitignore vendored
View File

@ -213,7 +213,3 @@ flycheck_*.el
/__simulate_fail.json /__simulate_fail.json
/mailing_list.yaml /mailing_list.yaml
.vscode/
*.code-workspace

View File

@ -118,10 +118,7 @@ data_channels: ["HHZ", "HHN", "HHE"]
# ---------------------------------------- OPTIONAL PARAMETERS --------------------------------------------------------- # ---------------------------------------- OPTIONAL PARAMETERS ---------------------------------------------------------
# deactivate powbox surveillance for stations (e.g. for solar powered), key: station, value: status message (abbr.) # deactivate powbox surveillance for stations (e.g. for solar powered), key: station, value: status message (abbr.)
no_pbox_stations: {'GR33': 'SOL', 'GR27B': 'DCN', 'RP01': 'noPBox', 'RP02': 'noPBox', 'RP03': 'noPBox', 'RP04': 'noPBox', 'RP05B': 'noPBox', 'RP06': 'noPBox', 'RP07': 'noPBox', 'RP08': 'noPBox'} no_pbox_stations: {'GR33': 'SOL'}
# deactivate mass position surveillance for stations without connected mass channels (e.g. STS-2 instruments), key: station, value: status message (abbr.)
no_mass_stations: {'BIA': 'DCN', 'KNEZ': 'DCN', 'KRUS': 'DCN', 'OHR': 'DCN', 'OTOV': 'DCN', 'SKO': 'DCN', 'STIP': 'DCN', 'VAY': 'DCN', 'ZUPA': 'DCN'}
# add links to html table with specified key as column and value as relative link, interpretable string parameters: # add links to html table with specified key as column and value as relative link, interpretable string parameters:
# nw (e.g. 1Y), st (e.g. GR01A), nwst_id (e.g. 1Y.GR01A) # nw (e.g. 1Y), st (e.g. GR01A), nwst_id (e.g. 1Y.GR01A)
@ -135,7 +132,7 @@ add_links:
add_global_links: add_global_links:
# for example: - {"text": "our homepage", "URL": "https://www.rub.de"} # for example: - {"text": "our homepage", "URL": "https://www.rub.de"}
- {"text": "show recent events on map", - {"text": "show recent events on map",
"URL": "https://fdsnws.geophysik.ruhr-uni-bochum.de/map/?lat=39.5&lon=21&zoom=7&baselayer=osm"} "URL": "https://fdsnws.geophysik.ruhr-uni-bochum.de/map/?lat=39.5&lon=21&zoom=7&baselayer=mapnik"}
# html logo at page bottom (path relative to html directory) # html logo at page bottom (path relative to html directory)
html_logo: "logo.png" html_logo: "logo.png"
@ -145,14 +142,14 @@ EMAIL:
# specify mail server and credentials # specify mail server and credentials
# port, auth_type, user and password are only required if mailserver is not set to "localhost" # port, auth_type, user and password are only required if mailserver is not set to "localhost"
# user and password can be set to "ENV" or "DOCKER" to read from environment variables or docker secrets # user and password can be set to "ENV" or "DOCKER" to read from environment variables or docker secrets
mailserver: "smtp.example.org" # mail server mailserver: "smtp.rub.de" # mail server
auth_type: "SSL" # mail authentication type, can be "SSL", "TLS" or "None" auth_type: "SSL" # mail authentication type, can be "SSL", "TLS" or "None"
port: 465 # mail port, default 465 for SSL, 587 for TLS port: 465 # mail port, default 465 for SSL, 587 for TLS
user: "DOCKER" # mail user, read from environment variable if set to "ENV" or from docker secret if set to "DOCKER" user: "DOCKER" # mail user, read from environment variable if set to "ENV" or from docker secret if set to "DOCKER"
password: "DOCKER" # mail password, read from environment variable if set to "ENV" or from docker secret if set to "DOCKER" password: "DOCKER" # mail password, read from environment variable if set to "ENV" or from docker secret if set to "DOCKER"
# specify mail recipients, sender and blacklists # specify mail recipients, sender and blacklists
addresses: ["test@example.org"] # list of mail addresses for info mails addresses: ["marcel.paffrath@rub.de", "kasper.fischer@rub.de"] # list of mail addresses for info mails
sender: "<test@example.org>" # mail sender sender: "RUB SeisObs <seisobs@ruhr-uni-bochum.de>" # mail sender
stations_blacklist: [] # do not send emails for specific stations stations_blacklist: [] # do not send emails for specific stations
networks_blacklist: [] # do not send emails for specific network networks_blacklist: [] # do not send emails for specific network
# specify recipients for single stations in a yaml: key = email-address, val = station list (e.g. [1Y.GR01, 1Y.GR02]) # specify recipients for single stations in a yaml: key = email-address, val = station list (e.g. [1Y.GR01, 1Y.GR02])

View File

@ -1,8 +1,8 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
__version__ = '0.3' __version__ = '0.2-docker'
__author__ = ['Marcel Paffrath <marcel.paffrath@rub.de>', 'Kasper D. Fischer <kasper.fischer@rub.de>'] __author__ = 'Marcel Paffrath <marcel.paffrath@rub.de>'
import os import os
import io import io
@ -595,7 +595,6 @@ class StationQC(object):
self.status_track = status_track self.status_track = status_track
self.powbox_active = self.is_pbox_activated_check() self.powbox_active = self.is_pbox_activated_check()
self.mass_active = self.is_mass_activated_check()
self.start() self.start()
@ -1081,11 +1080,6 @@ class StationQC(object):
""" Analyse datalogger mass channels. """ """ Analyse datalogger mass channels. """
key = 'mass' key = 'mass'
# skip processing if mass is not active
if not self.mass_active:
self.set_mass_inactive_error(key)
return
# build stream with all channels # build stream with all channels
st = Stream() st = Stream()
for channel in channels: for channel in channels:
@ -1347,12 +1341,6 @@ class StationQC(object):
msg = self.parameters.get('no_pbox_stations')[self.station] msg = self.parameters.get('no_pbox_stations')[self.station]
self.error(key, detailed_message=f'PowBox not connected', disc=msg) self.error(key, detailed_message=f'PowBox not connected', disc=msg)
def is_mass_activated_check(self):
return self.station not in self.parameters.get('no_mass_stations', [])
def set_mass_inactive_error(self, key):
msg = self.parameters.get('no_mass_stations')[self.station]
self.error(key, detailed_message=f'Mass channels not connected', disc=msg)
class Status(object): class Status(object):
""" Basic Status class. All status classes are derived from this class.""" """ Basic Status class. All status classes are derived from this class."""

View File

@ -19,13 +19,12 @@ def get_html_header(refresh_rate=10):
header = ['<!DOCTYPE html>', header = ['<!DOCTYPE html>',
'<html>', '<html>',
'<head>', '<head>',
' <title>SurvBot status</title>', ' <link rel="stylesheet" media="only screen and (max-width: 400px)" href="mobile.css" />',
' <link rel="stylesheet" media="only screen and (max-width: 400px)" href="mobile.css">', ' <link rel="stylesheet" media="only screen and (min-width: 401px)" href="desktop.css" />',
' <link rel="stylesheet" media="only screen and (min-width: 401px)" href="desktop.css">', '</head>',
f'<meta http-equiv="refresh" content="{refresh_rate}" >', f'<meta http-equiv="refresh" content="{refresh_rate}" >',
'<meta charset="utf-8">', '<meta charset="utf-8">',
'<meta name="viewport" content="width=device-width, initial-scale=1">', '<meta name="viewport" content="width=device-width, initial-scale=1">',
'</head>',
'<body>'] '<body>']
header = _convert_to_textstring(header) header = _convert_to_textstring(header)
return header return header