XMTPS: X-Message Mail-Telemetry Processing Service  0.6
Mail and telemetry processing service for Solo-II and ALAMO floats.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
xmtps: X-Message Mail-Telemetry Processing Service

xmtps is a compiled application for receiving, decoding, and processing telemetry data for ALAMO Hurricane floats and Solo-II Argo floats. It is written in C++11, LINUX shell scripts, and SQL.

Running xmtps as a LINUX daemon/service

The xmtps init.d script as been installed on Argus using insserv. The daemon may be controlled by users with root privileges with the following terminal command on Argus.

service xmtps {status|start|stop|restart}

Configuration

Configuration options may be set using command-line arguments and/or parsing a configuration file. Configuration options and their descriptions are given below.

Command-line Argument Syntax

The command-line interface (CLI) argument syntax is given below.

xmtps [OPTIONS]...

Short-form CLI options' syntax is given below.

xmtps [-dDhqRvV] [-c path] [-M n] [-n n] [-N n] [-p path] [-X path]...

General Configuration Options

The general configuration options are the only options that may not be configured in the configuration file. These options provide facilities for logging and general operational characteristics.

-c [ --config ] PATH (="../cfg/options.cfg")
Set the local filesystem path to the configuration file. If no configuration file is
present at the specified path a critical error will occur during startup and the program
will exit.
-D [ --daemon ]
Run as daemon process/service. If this option is set, then the program will run
indefinitely until termination is signaled by the user, or until the run-time lock is
revoked. Otherwise, the program will run once and then exit.
-d [ --debug ]
Enable debugging output. Debugging output is excessively verbose and is therefore neither
useful nor practical for general operation purposes.
-h [ --help ]
Print program usage message and options descriptions and then exit.
-q [ --quiet ]
Print less verbose output. Only warning and error message will be logged.
-R [ --reprocess-all ]
Reprocess all mail messages. All mail messages will be retrieved from the mail server and
reprocessed.
-v [ --verbose ]
Print more verbose output. Additional informational messages will be logged.
-V [ --version ]
Print the program version string and exit.
-X [ --decode-x-file ] PATH
Decode the binary X-Message (SBD) file located at PATH on the local filesystem. This
option may be specified multiple times to decode multiple messages on the local filesystem.
If this option is specified, the message(s) listed will be decoded and the program will
exit. No additional messages will be retrieved from the mail server and no messages others
than ones specified here will be processed, even if the application is configured to run as
a daemon.

File Generation Configuration Options

The following options may be provided in either the configuration file, or as command-line arguments. Options provided as command-line arguments will override options set in the configuration file.

-M [ --maxFetch ] N (=256)
Set the maximum number of mail message to simultaneously fetch from the mail server.
-n [ --nProcThrd ] N (=8)
Set the number of concurrent mail message processing threads to instantiate.
-N [ --nDecoThrd ] N (=16)
Set the number of concurrent telemetry decoder threads to instantiate.
-p [ --pid-file ] PATH (="/var/lock/xmtps/lock.pid")
Set the path to the PID file on the local filesytem. This PID file is used to ensure that
only a single instance of the program is running at any time. The file contains a single
ASCII integer corresponding to the PID of the running instance. It is created during
program initialization, and is removed upon termination. The file is checked periodically
during execution to ensure that it still exists and that the PID is correct.

Directory Configuration Options

These options are used to set paths to directories on the local filesystem to and from which files will be written and consumed by the application.

--dir.lis PATH (="lis")
Set the path to the intermediate listings directory on the local filesytem. Intermediate
listings will be generated and written to subdirectories of this path.
--dir.log PATH (="log")
Set the path to the log directory on the local filesystem.
--dir.mail PATH (="mail")
Set the ALAMO mail directory path. RAW mail message listings and binary SBD files generated from incoming mail messages will be written to sub-directories of this path.
RAW mail message files will be written to
<dir.mail>/raw/<SSSS>/raw<SSSS>-<MMMMMM>-<DDDD>.txt.
and SBD files will be written to
<dir.mail>/sbd/incoming/<SSSS>/<SSSS>-<MMMMMM>-<DDDD>.sbd where <SSSS> is the
instrument serial number, <DDDD> is the dive number, and <MMMMMM> is the MOMSN number
of the SBD packet.
--dir.meta PATH (="meta")
Set the ALAMO metadata directory path.
--dir.phy PATH (="phy")
Set the ALAMO PHY listing directory path. PHY listing files will be generated and
written to subdirectories of this path.

File Generation Configuration Options

These options are used to enable or disable generation of files on the local filesystem.

--gen.lis 0|1 (=1)
Generate ALAMO intermediate listing files. If TRUE, intermediate listing files will
be generated and written to the intermediate listing directory on the local
filesystem. Otherwise, intermediate listing files will not be generated or written
to the local filesystem.
--gen.phy 0|1 (=1)
Generate ALAMO PHY listing files. If TRUE, PHY listing files will be generated and
written to the PHY listing files directory on the local filesystem. Otherwise, PHY
listing files will not be generated or written to the local filesystem.
--gen.raw 0|1 (=1)
Generate ALAMO RAW mail message files. If TRUE, RAW mail message files will be
generated and written to the mail message directory on the local filesystem.
Otherwise, RAW mail message files will not be generated or written to the local
filesystem.
--gen.sbd 0|1 (=0)
Generate ALAMO binary SBD message files. If TRUE, binary SBD message files will be
generated and written to the mail message directory on the local filesystem.
Otherwise, binary SBD message files will not be generated or written to the local
filesystem.

Mail Server Configuration Options

These options are used to configure the remote mail server options and credentials.

--mail.host arg (=maila.whoi.edu)
Set the ALAMO mail server host qualified name or IP address.
--mail.folder arg (=INBOX)
Set the ALAMO mail server remote incoming message folder path.
--mail.password arg
Set the ALAMO mail server account password.
--mail.protocol arg (=imap)
Set the ALAMO mail server protocol.
--mail.user arg (=Alamo)
Set the ALAMO mail server account username.
--mail.vSend arg (=(sbdservice@sbd.iridium.com|service@sbd.pac.disa.mil))
Set the regular expression string to match valid ALAMO mail message sender(s).
--mail.vSubj arg (=SBD Msg From Unit: (\d+))
Set the regular expression string to match valid ALAMO mail message subject(s).
--mail.xDlyS arg (=60)
Set the minimum delay between subsequent checks of the mail server for new ALAMO
mail messages, in seconds.

MySQL Server Configuration Options

These options are used to configure the local MySQL database server options and credentials.

--sql.host arg (=127.0.0.1)
Set the SQL server qualified name or IP address.
--sql.password arg
Set the SQL server account password.
--sql.port arg (=3306)
Set the SQL server port number.
--sql.protocol arg (=tcp)
Set the SQL server protocol e.g. "tcp".
--sql.schema arg (=float)
Set the SQL server schema name.
--sql.user arg
Set the SQL server account username.

Database

MySQL is used as a back-end database solution for storing and retrieving persistent data that is needed by the application. The MySQL C++ Connector library is used to interface directly with the database. C++ classes are

Libraries

Boost C++ Libraries

Several of the Boost C++ libraries are utilized by xmtps.

See http://www.boost.org/.

program_options

The program_options library allows program developers to obtain program options, that is (name, value) pairs from the user, via conventional methods such as command line and config file.

See http://www.boost.org/doc/libs/1_55_0/doc/html/program_options.html.

filesystem

The Boost filesystem library provides facilities to manipulate files and directories, and the paths that identify them.

See http://www.boost.org/doc/libs/1_55_0/libs/filesystem/doc/index.htm.

log

The Boost log library provides facilities for logging, formatting, and manipulating logger attributes.

See http://www.boost.org/doc/libs/1_55_0/libs/log/doc/html/log/tutorial.html.

thread

Boost.Thread enables the use of multiple threads of execution with shared data in portable C++ code. It provides classes and functions for managing the threads themselves, along with others for synchronizing data between the threads or providing separate copies of data specific to individual threads.

Seehttp://www.boost.org/doc/libs/1_56_0/doc/html/thread.html.

MySQL C++ Connector

The MySQL C++ connector provides an API for accessing and manipulating a MySQL database. MySQL is used as a back-end database solution for storing and retrieving persistent data that is needed by the application.

See http://dev.mysql.com/doc/connector-cpp/en/.

VMime MIME & Mail Library for C++

See http://www.vmime.org/.