The Radiometrics RAMADDA National Mesonet Program Monitor is contained within a RAMADDA plugin. Below are instructions on how to build the plugin but as a convenience we make a release of the plugin in the lib directory.
This plugin runs under RAMADDA. To install RAMADDA on an AWS EC2 instance see https://geodesystems.com/repository/userguide/aws.html.
You can also run RAMADDA in other environments including on your laptop. More information is provided here.
Once RAMADDA is installed copy the rdxplugin.jar to the RAMADDA plugin directory on your server at:
<RAMADDA home>/plugins
e.g., on AWS this would be:
/mnt/ramadda/repository/plugins
Then restart the RAMADDA server. e.g.:
sudo service ramadda start
Along with the rdxplugin.jar plugin file there is some further configuration to do - specify the external RDX database and configure email and SMS settings. These configuration options are set in the rdx.properties file (example here). If not already done so copy this file to your RAMADDA server's home directory (e.g., /mnt/ramadda/repository on AWS).
You will need to specify the JDBC URL for the external instrument status database. This takes the form of:
rdx.db.url=jdbc:<database type>:<database path> rdx.db.user=<database user> rdx.db.password=<database password>
e.g. for running with Postgres on the same machine as RAMADDA use:
rdx.db.url=jdbc:postgresql://localhost/repository?UseServerSidePrepare=1&Protocol=-1
Note: There is only one place in the code that hard codes values that correspond to the database. The method:
RdxApiHandler.getRamaddaType(int rdxType)
maps the integer instrument types from the external RDX database to the internal RAMADDA String type entry identifiers.
You can run RAMADDA-RDX in test mode by setting the below property. This uses an internal test schema that mimics Radiometrics instrument status database.
rdx.test=true
To send email notifications when running in AWS EC2 you need to do a couple of things.
-
Enable AWS SES. First, you need to enable Amazon's Simple Email Service and verify your email addresses.
-
Configure RAMADDA. In RAMADDA's Admin Settings->Site and Contact Information page specify an administrator email (as specified in SES) and provide the Mail server, e.g.:
email-smtp.us-west-2.amazonaws.com
In the external rdx.properties file on your server you need to specify the smtp user and password from the AWS-SES configuration:
ramadda.admin.smtp.user= ramadda.admin.smtp.password= ramadda.admin.smtp.starttls=true
To send text message notifications we use RAMADDA's phone plugin which is included in the set of core plugins. If you have not installed the core plugins then build the phone plugin from the RAMADDA repository and copy it into the server's <ramadda home dir>/plugins directory.
The phone plugin uses Twilio as the message gateway. You will need to create an account with Twilio and configure your RAMADDA server. The 3 main properties to set in your rdx.properties are:
#Twilio account id twilio.accountsid= #Twili authorization token (for reading the transcription) twilio.authtoken= #Phone number twilio assigns you twilio.phone=
The initial instrument collection and associated content is provided as a RAMADDA export file. This is based on the example content at https://geodesystems.com/repository/a/rdxnmp. Download the rdxexport.zip file. Then, from your RAMADDA (assuming you are logged in) choose a folder to hold the content then from the folder's popup menu button () select Import and upload the rdxexport.zip file.
Once imported navigate to the Instrument Collection entry. Go to the Edit Properties page (from the entry popup menu) and change the "Some user" notification information to the desired values. Also, if you need more than one notification then go popup the entry menu and select "Add Notification". Important: make sure you click on the "Inherited" checkbox.
Building the plugin relies on the RAMADDA source tree to be installed as a sibling of this directory. Get the RAMADDA source with:
git clone https://github.com/geodesystems/ramadda.git
To build the plugin you need to have Java Ant installed (as well as Java JDK8+). Just run ant from the top-level directory.
ant
This builds dist/rdxplugin.jar and copies it into your local .ramadda/plugins directory. To release it to an external server you'll need to copy the plugin to the server's ramadda/plugins directory and restart the repository.
There are a number of other configuration options available in the rdx.properties file including preferred timezone and date format, time thresholds for determining when an notifications should be sent for an instrument, how often notifications should be sent, etc.
The plugin is in: src/com/radiometrics/plugin
The contents are:
-
RdxApiHandler.java - This is a singleton class that gets instantiated at runtime. Implements the /rdx/instruments and /rdx/notifications pages. Also creates 2 threads - one for monitoring the external instrument status database. One for handling notifications
-
api.xml - Defines the api endpoints into RdxApiHandler
-
RdxInstrumentTypeHandler.java - Represents the instruments. Just does the decoration of the datetime values
-
rdx.sql - Creates the test database table and the notification db
-
rdxtypes.xml - Defines the entry types - rdx instrument collection, rdx instrument. Note - the default page display for collections and instruments is defined within this xml file as an embedded wiki tag.
-
metadata.xml - Defines the notification metadata
-
rdxtemplate.html - provides the Radiometrics page template
-
htdocs/rdx/ - Holds images, documentation page, etc