Daemon

Contents / Standard Edition / User Guide / Agent / Daemon

myarmdaemon -- ARM data collection daemon

The agent daemon is running in the background and supports the MyARM agent in delivering the measured ARM data to its final database or archive. It allows the central administration component of MyARM to configure the running MyARM system using the so-called runtime configuration. Also it can be controlled by the myarmdaemoncmd command to stop it, query some information.

Command line options

Usage:

myarmdaemon [options]

The myarmdaemon command supports standard options described in the appendix "Standard options".

-tp port, --tcp-port port
specifies the port number to wait for incoming TCP data connections if tcp mode is enabled. This overwrites the configuration property.

Collection mode

The myarmdaemon can be executed in different data collection modes which can be configured using the daemon.collection.mode configuration property:

none
This defines that the myarmdaemon should not collect any ARM data. This is usefull if the myarmdaemon is configured to provide only management interfaces (e.g. runtime configuration, access to archive files, Apache Spark support, etc).
tcp
The myarmdaemon opens a TCP socket to listen for incoming ARM data connections from TCP datasinks.
file
The myarmdaemon scans the basic.filestorage.reader.directory for new ARM data files written by file datasinks.
tcp,file
The myarmdaemon opens a TCP socket to listen for incoming ARM data connections from TCP datasinks and scans the basic.filestorage.reader.directory for new ARM data files written by file datasinks.
tcp->file
The myarmdaemon opens a TCP socket to listen for incoming ARM data connections from TCP datasinks and writes all received ARM data to the basic.filestorage.reader.directory. Thus any ARM data received through a TCP socket is directly written to hard disk and later read in and written to its destination datasink as defined by the daemon.sink.name.

Main configuration

daemon.sink.name
specifies the datasink the received ARM data is written to if daemon.collection.mode configuration property is not set to none (see appendix "Configuring datasink component" for more details).
daemon.group
defines the group under which the myarmdaemon should be executed. If the myarmdaemon is started as super-user (root) it can change its group identity to the configured group name.

For example a myarm group.

daemon.user
defines the user under which the myarmdaemon should be executed. If the myarmdaemon is started as super-user (root) it can change its user identity to the user name.

For example a myarm user.

daemon.log.*
defines the logging message options and destination for the myarmdaemon program (See appendix "Configuring Log facility" for more details).
daemon.resource.watchdog.*
defines the resource watchdog logging for the myarmdaemon program (See appendix "Configuring resource watchdog" for more details).
daemon.pidfile
defines the file where the myarmdaemon writes its process id to.

Default is ${MYARM_VARRUN_DIR}/daemon.pid.

TCP server component

If the daemon.collection.mode configuration property was set to use the TCP server within the myarmdaemon, a TCP server listening socket will be created for listening for incoming connection requests from ARM instrumented applications using the tcp datasink. The following configuration properties can be used to control the TCP server component.

Configuration

daemon.tcp.host
defines the host/interface where the daemon listens for incoming data connections if the TCP part is enabled by the daemon.collection.mode.

Default host is localhost.

daemon.tcp.port
defines the port number where incoming connections are accepted if the TCP part is enabled by the daemon.collection.mode.

Default port is 5557.

daemon.tcp.max_clients
defines the maximum number of TCP clients if the TCP part is enabled by the daemon.collection.mode.

Note: This number should always be less than the number of allowed open files of the process. If not, the myarmdaemon tries to increase the number of open files of the process and if this fails, it terminates directly!

Default is 100, minimum is 1, maximum is 32768.

daemon.tcp.flowcontrol.threshold
if more than this percentage of ARM data buffers are in use, flow control will be enabled with the tcp datasink. If less than daemoon.tcp.flowcontrol.threshold ARM data buffers are currently used a new incoming ARM data buffer is acknowledged directly after reception. If more than daemon.tcp.flowcontrol.threshold ARM data buffers are in use, the acknowledgement of the reception is postponed until the ARM data buffer was processed and written to the myarmdaemon configured datasink.

Default is 10%, minimum is 5%, maximum is 50%.

Apache Spark component

The Apache Spark component is used in conjunction with the archive datasink. When the myarmdaemon is configured to store ARM data in the archive, it is possible to export ARM transaction measurement data to an Apache Spark instance using a TCP socket. The Apache Spark TCP client connects to the myarmdaemon Apache Spark TCP server and requests data in CSV format for a specified time interval.

Configuration

daemon.spark.enable (New since "4.1.x.0")
boolean which indicates if the daemon accepts Apache Spark client connections.

Default is false.

daemon.spark.host (New since "4.1.x.0")
defines the host/interface where the daemon listens for incoming Apache Spark connections.

Default host is localhost.

daemon.spark.port (New since "4.1.x.0")
specifies the Apache Spark TCP channel port to listen for Apache Spark connections.

Default is 5587.

daemon.spark.client.host (New since "4.1.x.0")
specifies the hostname or IP address from the Apache Spark client. If not empty, only connections from this host/interface are accepted

Default is localhost.

daemon.spark.csvformat (New since "4.1.x.0")
specifies the format string to format the CSV line for each transaction measurement sent to Apache Spark. See formatting a transaction.

Default is %h,%n,%S,%x,%E\n.

daemon.spark.archive.movefiles (New since "4.1.x.0")
specifies that a file should be moved from the source directory to the destination directory after reading in a MyARM data file.

Default is true.

daemon.spark.archive.sourcedir (New since "4.1.x.0")
specifies the source directory to read MyARM data files from.

Default is ${MYARM_VARLIB_DIR}/archive/current/.

daemon.spark.archive.destinationdir (New since "4.1.x.0")
specifies the destination directory to move files to when read in.

Default is ${MYARM_VARLIB_DIR}/archive/final/.

Archive reader component

The archive reader component provides a TCP socket interface for accessing files stored in the Archive. It is used by the myarmbrowser user interface and the myarmarchive command line tool to retrieve transaction data from the archive.

Configuration

daemon.armdata.enable (New since "4.1.x.0")
boolean which indicates if the daemon accepts archive reader client connections (true) or not (false).

Default is false.

daemon.armdata.host (New since "4.1.x.0")
defines the host/interface where the daemon listens for incoming archive reader connections.

Default host is localhost.

daemon.armdata.port (New since "4.1.x.0")
specifies the archive reader TCP channel port to listen for new connections.

Default is 5597.

daemon.armdata.format (New since "4.1.x.0")
specifies the format string to format the output for each transaction measurement returned by the archive reader. See formatting a transaction.

Default is %n\t%r\t%s\t%q %p %A %U %c\n.

Threshold reader component

The threshold reader component periodically checks the configured threshold directory for new threshold files, reads these files and stores the contents into the configured database.

Configuration

daemon.threshold.reader.enable
Boolean which indicates if the myarmdaemon should monitor the archive threshold directory for new threshold files (true) and to process such new files.

Default is true.

The myarmdaemon reads threshold files, stores contained data into the configured database and deletes the files afterwards. See basic.archive.database.url and basic.archive.database.threshold.name configuration properties for details.

daemon.threshold.reader.directory
Specifies the directory which should by periodically checked for new threshold files.

Default is ${MYARM_VARLIB_DIR}/archive/final/thresholds/.

daemon.threshold.reader.transaction.count.max
Specifies the maximum count per transaction definition of imported transactions within the defined transaction count interval (see next item). If zero is specified the limiting is disabled and all threshold transactions are imported into the database.

Default is 0 (zero), minimum is 0 (zero), maximum is 100000 (one hundred thousand).

daemon.threshold.reader.transaction.count.interval
Specifies the interval to be used for the limit to import threshold transaction into the threshold database.

Default is 1h (1 hour), minimum is 1m (1 minute), maximum is 24h (1 day).

daemon.threshold.reader.interval
Specifies the interval to check for new threshold files within the archive.

Default is 1m (1 minute), minimum is 1m (1 minute), maximum is 1h (1 hour).

daemon.threshold.reader.cleanup.interval
Specifies the interval to periodically clean up old threshold data within the threshold database.

Default is 1m (1 minute), minimum is 1m (1 minute), maximum is 1h (1 hour).

Old threshold data is the data which is older than current time minus the period specified in the basic.archive.cleanup.keep_data configuration property.

Command component

The myarmdaemon can be controlled using a TCP command channel (if enabled). This allows an administrator to adopt the behaviour of the myarmdaemon at runtime without stopping and restarting the myarmdaemon.

Commands

The following commands are currently supported:

help
queries all available commands for this daemon.
info
queries general version, build information and enabled features about the running daemon.
stop
signals the daemon to terminate.
status
queries current status information from the myarmdaemon process. It supports the following options:
clients
shows detailed information about TCP client threads.
speed
shows incoming data speed (bytes per second).
all
shows all available information.
long
shows more detailed information.
noheader
avoid printing a header. This is useful if myarmdaemoncmd is used to execute the status command in a loop.

Configuration

daemon.cmd.enable
enables or disables the command TCP channel for the myarmdaemon.

Default is true.

daemon.cmd.host
defines the host/interface where the daemon listens for incoming command connections.

Default host is localhost.

daemon.cmd.port
specifies the command TCP channel port to use.

Runtime configuration component

The runtime configuration component is used to accept new runtime configurations from the central myarmadmin web application using a TCP channel.

Configuration

daemon.runtime.config.enable
boolean which indicates if the daemon accepts new runtime configurations (true) from the runtime administration web frontend or not (false).

Default is false.

daemon.runtime.config.localhost (New since "4.0.x.0")
boolean which indicates if the daemon should listen on localhost (true) for accepting runtime configuration connections or on the default interface of the host (false).

Default is true.

daemon.rts.enable
boolean which indicates if the daemon should calculate real time statistics (RTS) (true) or not (false). Note this only works if runtime configuration is enabled and appropriate RTS definitions are available.

Default is false.

Web application component

Starting with version 4.1 of MyARM the myarmdaemon can start the standalone web applications provided by MyARM. This can be enabled by specifying the interface/host and port on which the HTTP server of the web application should listen for incoming HTTP connections.

daemon.web.admin.http
defines the interface/host and port (delimited by a colon) on which the myarmadmin should listen for incoming HTTP connections. If an empty string is specified this feature will be disabled. For example localhost:8081 is commonly used for local HTTP server instances.

Default is "" (empty string).

daemon.web.browser.http
defines the interface/host and port (delimited by a colon) on which the myarmbrowser should listen for incoming HTTP connections. If an empty string is specified this feature will be disabled. For example localhost:8080 is commonly used for local HTTP server instances.

Default is "" (empty string).

daemon.web.rtsbrowser.http
defines the interface/host and port (delimited by a colon) on which the myarmrtsbrowser should listen for incoming HTTP connections. If an empty string is specified this feature will be disabled. For example localhost:8082 is commonly used for local HTTP server instances.

Default is "" (empty string).

daemon.web.rtsmonitor.http
defines the interface/host and port (delimited by a colon) on which the myarmrtsmonitor should listen for incoming HTTP connections. If an empty string is specified this feature will be disabled. For example localhost:8083 is commonly used for local HTTP server instances.

Default is "" (empty string).

Configuration example

# myarmdaemon processing mode: receive data via TCP and 
# store received data into a MySQL/MariaDB database
daemon.collection.mode = tcp
# set up host/interface and port where myarmdaemon is listening
# for incoming data connections, limit to 100 concurrent clients
daemon.tcp.host = localhost
daemon.tcp.port = 5557
daemon.tcp.max_clients = 100
# myarmdaemon TCP flow control threshold
daemon.tcp.flowcontrol.threshold = 10
# use MySQL datasink database
daemon.sink.name = db_mysql
# myarmdaemon process user/group name and pid file
daemon.user = myarm
daemon.group = myarm
daemon.pidfile = /opt/myarm/var/daemon.pid
# set up host/port where myarmdaemon is listening for command
# connections
daemon.cmd.host = localhost
daemon.cmd.port = 5554
See Also
myarmoptions, myarmconfig, myarmdaemoncmd