系统包含各种模块,如数据获取,数据归档、处理、分发等等。控制这些模块,以及更新模块配置需要使用 seiscomp 工具。该 Python 脚本位于 bin/seiscomp
。
整个管理框架基于 Python,要使 seiscomp 正常工作,确保系统安装 Python。
要获取所有有效的命令说明,可执行:
user@host:~$ seiscomp3/bin/seiscomp help
Available commands:
install-deps
setup
shell
enable
disable
start
stop
restart
check
status
list
exec
update-config
alias
print
help
Use 'help [command]' to get more help about a command
安装第三方包,如 base、mysql-server、postgresql-server
仅安装基本系统依赖包
seiscomp install-deps base
安装基本系统依赖包和 MYSQL 服务
seiscomp install-deps mysql-server
安装基本系统依赖包和 PostgreSQL 服务
seiscomp install-deps postgresql-server
更新配置。模块应能够读取 etc
中的配置文件。有些模块如 Seedlink 需要将配置文件转换成所需格式。如果未提供模块列表,将更新所有有效的模块配置。
打开交互 SeisComP终端 界面。
允许模块执行。该命令为每个模块创建一个 etc/init/[module].auto
文件。
禁止模块执行。该命令删除模块相应的 etc/init/[module].auto
文件。
SeisComP 终端调用:
user@host:~$ seiscomp3/bin/seiscomp shell
================================================================================
SeisComP shell
================================================================================
Welcome to the SeisComP interactive shell. You can get help about
available commands with 'help'. 'exit' leaves the shell.
$
终端协助管理模块台站的绑定,支持:
输入 help 获取可支持的命令列表。所有命令说明会立即写入磁盘而非缓冲。
为所有 GE 台站指定scautopick 全局属性
$ set profile scautopick global GE.*
对来自 GE 网络的 scautopick,用台站配置替代所有属性
$ remove profile scautopick global GE.*
显示 GE.MORC 台站的绑定信息
$ print station GE.MORC
所有模块的初始化脚本放在 etc/init
目录。seiscomp 载入所有的 .py
文件并试着查找名为 Module 的类。该类列示了有关的环境对象,如果不发生错误该模块将被注册。
初始化脚本的名称可忽略并且无用。仅有 Module 对象的名称是重要的,用于标识模块能够被放入初始化脚本中。
Module 类必须通过 seiscomp 实现接口。一个简单实现:
import seiscomp3.Kernel
class Module(seiscomp3.Kernel.Module):
def __init__(self, env):
seiscomp3.Kernel.Module.__init__(self, env, env.moduleName(__file__))
SeisComP3 提供 Python 模块(seiscomp3.Kernel) ,允许很容易写出初始化脚本。