Daemon

Documentation / C/C++ Edition / User Guide / Agent / Daemon

myarmdaemon -- ARM data collection daemon

The agent daemon (or under Windows daemon service) is running in background and support the MyARM agent in delivering the measured ARM data to its final database. 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 or query some status information.

Windows service

Under Windows it is possible to start the agent daemon as a Windows service. To support Windows services the following command line options are available:

--install starttype
installs the agent daemon as a Windows service. The optional starttype defines the start type of the installed service. If starttype is omitted demand is used. The following start types are supported:
demand
Start the service manually on demand
auto
Start the service automatically
delayedauto
Start the service automatically but use a delayed start. Only available on Windows Vista or above.

Note that in some environments it is necessary to use the delayed auto start of the MyARM daemon service to work properly.

--uninstall
uninstalls a previously installed agent daemon.
--run
runs the agent daemon as a Windows service. This option should not be used manually. It is used to start the service through the Windows service management interface.

Command line options

Usage:

myarmdaemon [options]

The myarmdaemon command supports standard options described in appendix "Standard options" and Windows service options described above.

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

Configuration

The myarmdaemon program can be configured using the following properties in the configuration file. With the daemon.collection.mode configuration property the operation mode is defined.

daemon.collection.mode (New since "3.0.x.0")
defines the ARM data collection mode of the myarmdaemon. The following modes are supported:
none
This defines that the myarmdaemon should not collect any ARM data instead it can be used to listen for new runtime configurations. See daemon.runtime.config.* properties below.
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.
daemon.runtime.config.enable (New since "3.0.x.0")
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 (New since "3.0.x.0")
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.

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 maximal 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 maximal number of open files of the process and if this fails it terminates directly!

Default is 100.

daemon.tcp.flowcontrol.threshold (New since "3.0.x.0")
percentage of currently in used ARM data buffers to enable flow control 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 after the ARM data buffer was processed and written to the myarmdaemon configured datasink.

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

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.
daemon.group
defines the group under which the myarmdaemon should be executed. If the myarmdaemon is started under the super-user (root) it can changes its group identity to the here configured group.

For example a myarm group.

daemon.pidfile
defines the file where the myarmdaemon writes its process id to.

Default is ${MYARM_VARRUN_DIR}/daemon.pid.

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

For example a myarm user.

daemon.sink.name
specifies the datasink the received ARM data is written to. (See appendix "Configuring datasink component" for more details)
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 watch dog logging for the myarmdaemon program. (See appendix "Configuring resource watch dog" for more details)

Configuration example

# myarmdaemon processing mode receive data through TCP and 
# temporarily store data into file before storing into MySQL
daemon.collection.mode = tcp->file
# set up host/interface and port 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 myarmdaemon is listening for command connections
daemon.cmd.host = localhost
daemon.cmd.port = 5554
# set up directory to move closed work files to
basic.filestorage.reader.directory = /opt/myarm/var/myarmfiles
# scan the directory each 5 seconds.
basic.filestorage.reader.directory.scan.period = 5
See Also
myarmoptions, myarmconfig, myarmdaemoncmd