ShakeMap modules supporting the AQMS system.
These modules replace queue, eq2xml, and db2xml from ShakeMap V3.5.
NOTICE: I do not intend to support these modules. Hopefully, a conscientious AQMS user will fork this repo and take over maintenance of these modules. If that's you, contact me and let me know, and I'll freeze this repo and point our documentation to your repo.
-
Install ShakeMap V4 and its dependencies. See https://github.com/usgs/shakemap for details.
-
Use pip or conda to install the python library cx_Oracle. See http://cx-oracle.readthedocs.io/en/latest/installation.html# for detailed instructions.
-
If they are not already on your system, install the appropriate Oracle client libraries. This topic is covered in the cx_Oracle install instructions mentioned above.
-
Do
pip install git+git://github.com/cbworden/shakemap-aqms.git
. As an alternative, you can clone the repo and usepip install
on the local directory where you cloned the repo. -
Configure your shake.conf file so that
coremods
includesshakemap_aqms.coremods
. -
Copy the file aqms.conf from the shakemap_aqms/config directory into your <INSTALL_DIR>/config directory and edit it following the instructions therein. You must configure at least one database but you may configure multiple databases. The databases will be used in the lexicographic order of the names of their subsections.
-
You should then be able to add
aqms_eq2xml
andaqms_db2xml
to yourshake
command line. -
The old 'queue' process has been replaced with two processes:
aqms_queue
andsm_queue
. To use them, copyaqms_queue.conf
from the shakemap_aqms/config directory into your <INSTALL_DIR>/config directory and edit it to receive messages on the same port (and from the same servers that your current (SM 3.5)queue
process does. You may then runaqms_queue
and it will receive the notifications from the oldshake_alarm
andshake_cancel
scripts that your AQMS systems are running. There are new python versions ofshake_alarm
andshake_cancel
that may be used if desired. (Don't forget to edit those scripts to set the remote host and port number according to your installation andaqms_queue.conf
.) The next step is to getqueue.conf
from shakemap/data in the shakemap repository and put it in your <INSTALL_DIR>/config, and edit according to your preferences. You can then runsm_queue
.The way this setup works is that your database will use
shake_alarm
(orshake_cancel
) (either the old Perl or new Python versions -- they do the same thing) to notifyaqms_queue
of an event.aqms_queue
will then retrieve the event information and pass it tosm_queue
.sm_queue
will make a decision on processing the event based on its configuration. If the event is to be processed,sm_queue
will create the event directory and writeevent.xml
into it, and then runshake --autorun <eventid>
(which uses theautorun_modules
settings inshake.conf
to decide which modules to run). Note that in this case you do not need to includeaqms_eq2xml
in the modules becauseevent.xml
will have already been written to the event's current directory bysm_queue
.
These modules are provided as-is, with no guarantee of anything. See the license file.