-
Notifications
You must be signed in to change notification settings - Fork 0
/
ese.env
71 lines (61 loc) · 2.6 KB
/
ese.env
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Env
## SeisComP
source <(/opt/seiscomp/bin/seiscomp print env)
#export LD_LIBRARY_PATH="/opt/seiscomp/lib/:$LD_LIBRARY_PATH"
#export SEISCOMP_ROOT="/opt/seiscomp/"
#export LD_LIBRARY_PATH="$SEISCOMP_ROOT/lib:/usr/local/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH"
#export PYTHONPATH="$PYTHONPATH:$SEISCOMP_ROOT/lib/python"
#export MANPATH="$SEISCOMP_ROOT/share/man:$MANPATH"
#export PATH="$SEISCOMP_ROOT/bin:$PATH"
#source $SEISCOMP_ROOT/share/shell-completion/seiscomp.bash
echo \$SEISCOMP_ROOT is $SEISCOMP_ROOT
## FinDer
export FinDer_INCLUDE_DIR=/usr/local/include/finder
export FinDer_LIBRARY=/usr/local/lib/libFinder.a
# Checks
## Seiscomp
echo SeisComP:
/opt/seiscomp/bin/seiscomp exec scmaster --version
seiscomp status |grep -i -e ' is running' -e 'WARNING'
echo IF SEISCOMP IS DEAD RUN: $SEISCOMP_ROOT/seiscomp restart
## FinDer
echo FinDer-in-a-Docker:
docker exec -u sysop FinDer-in-a-Docker /opt/seiscomp/bin/seiscomp exec scmaster --version
docker exec -u sysop FinDer-in-a-Docker /opt/seiscomp/bin/seiscomp status |grep -i -e 'is running' -e 'WARNING'
echo IF FinDer-in-a-Docker IS DEAD RUN:
echo " " docker start FinDer-in-a-Docker
echo " " docker exec -u sysop FinDer-in-a-Docker /opt/seiscomp/bin/seiscomp restart
## ActiveMQ
echo ActiveMQ:
systemctl status activemq.service|grep -i -e 'active (running)'
echo IF ActiveMQ IS DEAD RUN: systemctl restart activemq.service
## Time
echo Timing:
cat </dev/tcp/time.nist.gov/13
date
## Instructions
echo 👋 For instructions about how to maintain the EEW SeisComP setup on this server see ~/README.md
# Utility functions
## VS likelihood info
function like () {
set +x
grep -h "$1" .seiscomp/log/scvsmag-processing-info.log*|grep "median single-station-mag"|tr -s ";" " "|awk '{printf "%s | MAG CHECK: %s - %s / %s = %s\n",$0,$5,$8,$5,($5-$8)/$5}'
grep -h "$1" .seiscomp/log/scvsmag-processing-info.log*|grep "Distance threshold"
grep -h "$1" .seiscomp/log/scvsmag-processing-info.log*|grep "gap"
}
## Git utility for seiscomp config
scgit () {
# system config
INSTITUTE=marn
git -C "$SEISCOMP_ROOT" checkout -b $INSTITUTE
scgitinit
git -C "$SEISCOMP_ROOT" commit
git -C "$SEISCOMP_ROOT" push origin $INSTITUTE
# user config
scxmldump -d mysql://192.168.2.245/seiscomp3 -Cf > ~/.seiscomp/scxmldump/lastconfiguration.xml
scxmldump -d mysql://192.168.2.245/seiscomp3 -If > ~/.seiscomp/scxmldump/lastinventory.xml
git -C ~/.seiscomp/ checkout -b $INSTITUTE
git -C ~/.seiscomp/ add --all
git -C ~/.seiscomp/ commit
git -C ~/.seiscomp/ push origin $INSTITUTE
}