Copyright (C) 2012-2026 by Andrej Koslov. MIT License. · UMAgent Documentation · Software Version 4.1.0

Universal Monitoring Agent 4.1.0

Introduction

The UM-Agent acts as a mediator. It extracts and prepares measurement data from various sources and sends it to monitoring or analytics systems. These sources include, for example, log files, system parameters from Linux or Windows performance counters, the Windows EventLog, and the output of any commands or programs that supply data from databases, APIs, etc.

Download Windows version 4.1.0
Download Linux version 4.1.0
Source code on GitLab

Release Notes

Version 4.1.0 30.10.2026

New

Changed

Fixed

Version 4.0.0 11.10.2026

Port of the Java version to the programming language Go. The configuration files stay largely compatible. The most important differences:

User Guide

Contents

  1. Requirements
  2. Installation
    1. On Linux
    2. On Windows
  3. Start parameters
  4. Configuration file
    1. Global configuration parameters
    2. Sender
    3. Structure of a check
    4. Check group logfile
      1. Type finde_digit
      2. Type finde_string
      3. Dynamic path
    5. Check group command
    6. Check group syslinux
      1. Monitoring CPU usage
      2. RAM and swap statistics
      3. Monitoring network interface
      4. Monitoring file system
      5. Monitoring block device
    7. Check group syswindows
    8. Check group eventlog
    9. Encryption
  5. Examples
    1. finde_digit
    2. finde_string
    3. Common errors
  6. License terms

Requirements

Installation

On Linux

Install the DEB package (Debian, Ubuntu) with apt install ./umagent_*_amd64.deb

Install the RPM package (RHEL, Rocky Linux, AlmaLinux) with rpm -i ./umagent-*.rpm

The package puts the program in /usr/sbin/umagent, the configuration files and examples in /etc/umagent and the log files in /var/log/umagent. The service does not start automatically. First adapt /etc/umagent/umagent.xml, then:

On Windows

Unpack UM-Agent_[Version].zip

install.cmd 

After the installation the configuration files must be adapted. You can use the examples in the folder cfg as a base. With umagent -list you can check the configuration in advance.

Start parameters

Configuration file

In the following, mandatory parameters are marked with [P], optional parameters with [O].

Global configuration parameters

The global configuration parameters control the work of the agent as a whole. Example:

<umagent>
    <common logdir="../log" keepdays="30" sender="HTTP-POST"/>
    <server host="monitor.example.com" objcode="SRV000000000001"
        authtype="basic" authuser="agent" authpwd="secret"/>
    <include>
        <cfgfile path="../cfg/syst.xml"/>
        <cfgfile path="../cfg/appl.xml"/>
    </include>
    <check>
        ....
    </check>
</umagent>

Sender

The parameter sender in <common> defines how the measured values are transmitted to the Recipient. Only one sender is used at a time.

Every measured value is sent to the Recipient as a data record in the format Object-Code|Parameter-Number|Value|Time, e.g. SRV000000000001|1|10.30|2026-10-24T08:30:00Z. The time is the time of the measurement (UTC, ISO 8601). With HTTP the agent encodes the special characters in URL notation (| as %7C).

Notes on HTTP-POST and HTTP-GET:

Structure of a check

A check is the collection of the measured values of one parameter. There are five sources for the measurement data. Every source is called a group.

The groups

The groups syslinux and syswindows deliver measured values directly. The three other groups need an additional set of rules to extract the wanted measured values from the character strings. There are two types of rules:

All configuration parameters of a check can be divided into three areas:

Example of the general parameters of a check:

<check parname="." uom="." step="." parnum="." active="." objcode=".">
    <desc>...</desc>
    <group>...</group>
    <type>...</type>
    <calc operation=".."/>
    <default>N</default>
</check>

The conversion with <calc> is helpful in some cases, e.g. to convert the throughput of a network card from byte/s to MB/s:

<calc operation="/ 1048576"/>

Or if a check is executed in steps of 5 minutes, to convert the measuring result to a value per minute:

<calc operation="/ 5"/>

Check group logfile

The check group logfile processes log files in text format. Only lines that are added after the start of the agent are evaluated. A line is processed only when it is finished with a line break. Rotating log files are detected automatically if the step of the check is smaller than the step of the rotation. On Linux, if a log file was renamed or moved during the pause, the lines that were written to the old file during that pause are also taken into account. On Windows this is not the case: the file is closed after every step so that the writing application can rotate it.

The type of the check specifies how measurement data is extracted. For the search, search rules are defined in <rule> elements. A search rule is either a regular expression in RE2 syntax (in the following Regexp) or a cut-out of a certain column (in the following Split). The prerequisite for the split is a line with columns separated by a separator character (CSV format). The separator can be any single character. In one check several split rules and several Regexp can be applied one after the other (cascade). Every following rule searches the result of the previous rule. A Regexp returns the part in the first round brackets as result. In 99.99% of the cases simple Regexp are sufficient.

Example of a cascade of split and Regexp. The log file contains lines like:

2026-10-15 10:23:41|INFO|jboss|worker-3|Queue|Incoming messages: 84|
<check parname="IncomingMessages" uom="Msg/Min" step="120" parnum="13" active="1">
    <desc>The check extracts amount of incoming messages/min</desc>
    <group>logfile</group>
    <type>finde_digit</type>
    <path>/var/log/app/jboss/server.log</path>
    <rule>
        <delimiter>|</delimiter>
        <column>5</column>
    </rule>
    <rule>
        <regexp>Incoming messages: (\d+)</regexp>
    </rule>
    <sendback>sum</sendback>
    <default>0</default>
    <calc operation="/ 2"/>
</check>

This is how the check works:

  1. The first rule splits the line at the character | and takes column 5 (counting starts at 0, so it is the sixth column): Incoming messages: 84.
  2. The second rule searches this result with the Regexp. The part in the round brackets is the number 84.
  3. In the step (120 seconds) several lines can occur. <sendback>sum</sendback> adds all numbers found.
  4. <calc operation="/ 2"/> divides the sum by 2: the step takes 2 minutes, the result is a value per minute (Msg/Min).

Also in the last Regexp the search result must be put in round brackets. The string in the round brackets is interpreted as the final result.

Type finde_digit

With the search rules above, this check extracts one number from every new line of the source (log file or command output). If several lines with numbers occur in a step, the check combines these numbers according to <sendback> and sends back, depending on the setting, the minimum, the maximum, the first value, the last value, the average or the sum. Lines without a match are skipped. Valid numbers are integers and floating point numbers:

E.g. "1.0020", "-0,23456", "+10000.12345686". Numbers with many digits are hard to read, therefore you can convert the result with the element <calc>. For example conversion from byte to MB:

<calc operation="/ 1048576"/>

Example of a check of the type finde_digit:

<check parname="." uom="." step="." parnum="." active=".">
    <group>logfile</group>
    <type>finde_digit</type>
    <path>/var/log/app/server.log</path>
    <default>0</default>
    <sendback>sum</sendback>
    <rule>
        <regexp>Tried to connect (\d+) times</regexp>
    </rule>
</check>
Type finde_string

The check looks for a certain text pattern in every new line of the source (log file or command output) and sends back the number of lines in which the search pattern occurs. A line is counted if the result of the last rule is not empty. Search rules work exactly as with the type finde_digit. Example of a check of the type finde_string:

<check parname="." uom="." step="." parnum="." active=".">
    <group>logfile</group>
    <type>finde_string</type>
    <path>../log/trace.log</path>
    <rule>
        <regexp>(\|ERROR\|)</regexp>
    </rule>
    <default>0</default>
</check>
Dynamic path

Some applications create log files whose path or file name changes over time, e.g. /var/log/app-20160929-10.log. The UM-Agent can handle such files if the path or file name contains date, time or weekday. It is detected automatically whether the path contains dynamic elements. The following dynamic elements are available:

Instead of the question mark, L or S must be used.

The example path on 29 September from 10:00 to 10:59:

/var/log/app-20160929-10.log

The corresponding path in the element <path>:

<path>/var/log/app-%LYYYY%%LMM1%%LDD%-%LHH24%.log</path>

The dynamic path contains the following elements:

Check group command

The check group command executes a command in every step and extracts the measured value from its output. The output is treated like the content of a log file: every line passes the search rules (<rule>), and the type finde_digit (extract a number) or finde_string (count matches) forms the measured value from it. The standard output (STDOUT) is evaluated, or with <source>STDERR</source> the error output. The command is started without a shell; arguments with blanks are put in quotation marks. For pipes, redirections or several commands one after the other you call the shell yourself: on Linux sh -c "...", on Windows cmd /c "..." or powershell -NoProfile -Command "...".

A return code other than 0 is logged as an error, the output is evaluated anyway. If the command runs longer than <timeout>, it is cancelled and the output received up to then is evaluated. For the extraction of the measurement data the two types finde_string and finde_digit are available. Checks with the same command and the same step share one execution. This saves memory and avoids that the command is executed several times. Example of a check of the group command with the type finde_string:

<check parname="." uom="." step="." parnum="." active=".">
    <group>command</group>
    <type>finde_string</type>
    <execute>sh -c "ps -ef | grep apache"</execute>
    <timeout>2</timeout>
    <rule>
        <regexp>(Strang-1)</regexp>
    </rule>
</check>

Example of a check of the group command with the type finde_digit:

<check parname="." uom="." step="." parnum="." active=".">
    <group>command</group>
    <type>finde_digit</type>
    <execute>curl -s http://localhost:8080/status</execute>
    <rule>
        <regexp>queueSize=(\d+)</regexp>
    </rule>
</check>

Check group syslinux

The check group syslinux is available only on Linux and collects Linux specific parameters from /proc, /sys and the command df. In the element <type> you specify which statistic is needed. The following chapters list which types are available. Checks of the same subgroup (cpu, mem, net, fs, bdev) with the same step are collected together. For CPU, network and block device the values are calculated as the difference to the previous step; the first value therefore comes after one step. You find an example in /etc/umagent/umagent.xml.

Monitoring CPU usage

The CPU checks collect the statistics over all cores. Unit of measurement %. The following types are available:

RAM and swap statistics

The memory checks collect the statistics about RAM and swap. The following memory checks are available:

Monitoring network interface

The network checks collect the statistics about any network interfaces. The checks need the logical network interface in the element <if>, e.g. <if>eth0</if>. If the interface does not exist at the start, the check is disabled. The following network checks are available (values per second):

Monitoring file system

The file system checks determine the usage of the local file system under a mount point. Unit of measurement %. The check needs the path to the mount point in the element <path>. The check uses the Linux command "df", which is part of every Linux distribution. The following file system checks are available:

Monitoring block device

The block device checks determine statistical data of a block device. A hard disk, partition, RAID, LUN or multipath device or a logical partition of them can serve as a block device. For this, the path to the block device or mapper link is needed in the element <path>. The following block device checks are available:

Check group syswindows

The check group syswindows is available only on Windows. It delivers system performance data from the Windows performance counters. The agent reads them directly via the Windows interface PDH. In the element <type> you give one unique performance counter.

The names of the performance counters are always given in English, regardless of the language of the operating system. Names in the language of the operating system (e.g. "\Prozessor(_Total)\Prozessorzeit (%)") are not accepted. Examples:

For the performance counters of the processes (\Process(…)\% Processor Time) the agent delivers the value per CPU core (logical processor): 100 % is a fully used core. A program with several threads or the sum of several processes can therefore exceed 100 %, the maximum value is 100 % times the number of cores. If you need the share of the total CPU (0–100 %), convert it with <calc>, e.g. with 22 cores: <calc operation="/ 22"/>. The number is in the environment variable NUMBER_OF_PROCESSORS.

How do I find the names of the performance counters?

The easiest way is the PowerShell script list-perfcounters.ps1, which is delivered together with the UM-Agent. It lists the performance counters with English names, as the agent expects them in the element <type>, on Windows in any language:

powershell -ExecutionPolicy Bypass -File list-perfcounters.ps1

Show instances in an object, e.g. LogicalDisk

powershell -ExecutionPolicy Bypass -File list-perfcounters.ps1 -Object LogicalDisk -Instances
powershell -ExecutionPolicy Bypass -File list-perfcounters.ps1 -Object LogicalDisk -Instances | findstr /C:"Free Space"

The performance counters with * in their name must not be used!

Note on the language: For some newer objects (e.g. "TCP/IP performance diagnostics", "SMB server shares", "QUIC performance diagnostics", "WMIPrvSE health status") there are no English names on a non-English Windows.

Alternatively you can show the performance counters in the language of the operating system with typeperf.exe. On an English Windows the names can therefore be used directly:

Unknown performance counters are detected when the agent starts and are disabled with an error message in the log file. With umagent -list you can check the names without starting the agent.

The values are collected in 5-second intervals. This creates several measuring results per step. Therefore the element <sendback> can be used. Default is "avg" (average). In some cases another function makes more sense, e.g. for the usage of a partition "last" is better suited. All syswindows checks with the same step are collected together. Example of a check of the group syswindows with conversion from bytes to MBytes:

<check parname="DiscWriteC" uom="MB/s" step="60" parnum="7" active="1">
    <group>syswindows</group>
    <type>\LogicalDisk(C:)\Disk Write Bytes/sec</type>
    <calc operation="/ 1048576"/>
</check>

More examples in ..\cfg\example-syswindows.xml.

Check group eventlog

The check group eventlog is available only on Windows. The agent reads the events directly via the Windows interface of the event log. In every step all new events are read that occurred since the last step; in the first step all since the start of the agent. Events from the time when the agent was not running are not read. The reading is limited to 10 seconds per step.

Every event is converted to one line, the fields are separated by "|":

Time|Level|EventID|Source|Text

The search rules are applied to this line. For the extraction of the measurement data the two types finde_string and finde_digit are available. The element <path> contains the name of the event log (channel). By default the following event logs exist on Windows: System, Application, Setup, Security – regardless of the language of the operating system. Channels like "Microsoft-Windows-TaskScheduler/Operational" are also possible. If the channel does not exist at the start, the check is disabled.

The example with the type finde_string counts critical events in the event log System:

<check parname="EventSysCritical" uom="Error/Min" step="300" parnum="9" active="1">
    <desc>Check critical events in system eventlog.</desc>
    <group>eventlog</group>
    <type>finde_string</type>
    <path>System</path>
    <calc operation="/ 5"/>
    <rule>
        <regexp>^[^|]*\|(Critical)\|</regexp>
    </rule>
</check>

With split rules you can access a certain field. The example counts crashes of applications (EventID 1000 in the event log Application):

<rule>
    <delimiter>|</delimiter>
    <column>2</column>
</rule>
<rule>
    <regexp>^(1000)$</regexp>
</rule>

For test purposes you can create an event yourself:

eventcreate /T ERROR /ID 158 /L APPLICATION /D "This is a test-event"

The test event is converted to the following line and then searched:

2026-10-03T21:45:24|Error|158|EventCreate|This is a test-event

Encryption

The agent can encrypt the data records (RSA-OAEP with SHA-256). It encrypts with the public key of the Recipient, only the Recipient with the private key can read them. The result is sent as Base64, with HTTP in the parameter umagent_record.

Activate

  1. Create a key pair (see below).

  2. Copy the file with the public key to the folder of the umagent.xml.

  3. Enter the file name in <common>:

    <common logdir="../log" keepdays="30" sender="UDP" encryption_key="umagent_public.pem"/>
    

If the file is not readable or is not a valid RSA key with at least 2048 bits, the agent does not start. It never sends unencrypted if the encryption is configured.

Create a key pair (e.g. 3072 bits, on the Recipient or on an administration computer):

openssl genrsa -out umagent_private.pem 3072
openssl rsa -in umagent_private.pem -pubout -out umagent_public.pem

Without an installed OpenSSL (e.g. on Windows) with Docker, in the current folder:

docker run --rm -v "%cd%:/k" -w /k alpine/openssl genrsa -out umagent_private.pem 3072
docker run --rm -v "%cd%:/k" -w /k alpine/openssl rsa -in umagent_private.pem -pubout -out umagent_public.pem

(In PowerShell use ${PWD} instead of %cd%.) Only umagent_public.pem goes to the agent. The private key umagent_private.pem stays with the Recipient and must not be copied to the agent.

Decrypt at the Recipient: decode Base64, then decrypt with RSA-OAEP and SHA-256. For a test with OpenSSL:

base64 -d record.b64 > record.bin
openssl pkeyutl -decrypt -inkey umagent_private.pem -pkeyopt rsa_padding_mode:oaep -pkeyopt rsa_oaep_md:sha256 -pkeyopt rsa_mgf1_md:sha256 -in record.bin

Examples

The examples show the different possibilities to monitor parameters in log files with the types finde_digit and finde_string.

finde_digit

For example, we look in a log file for a certain pattern from which a number is to be extracted. Because the search pattern can occur in several lines, the average is to be sent to the Recipient. Here is an example line from the log file:

2012.05.20 20:23:23|INFO|Some-Modul...| ... Tried to connect XXX times|....||

This is achieved with the type finde_digit and a Regexp rule. The rule looks for the text "Tried to connect", followed by a number. The part in round brackets is interpreted as the number you are looking for. The check analyzes all new lines every 120 seconds. The average of all numbers found is sent to the Recipient with the parameter number 1.

<check parname="ConnectTries" uom="-" step="120" parnum="1" active="1">
    <group>logfile</group>
    <type>finde_digit</type>
    <path>../log/random.log</path>
    <rule>
        <regexp>Tried to connect (\d+) times</regexp>
    </rule>
    <sendback>avg</sendback>
</check>

If the number you are looking for has decimal places (e.g. "123,2334"), you have to extend the Regexp:

<regexp>Some result (\d+,\d+)</regexp>

finde_string

The check delivers the number of lines from the log file in which the Regexp expression you are looking for was found. The search rules work on the same principle, therefore here only a list with different examples of Regexp expressions.

Examples of regular expressions

Common errors

License terms

The UM-Agent is under the MIT license. It contains code of the following third parties. All trademarks and registered trademarks mentioned here are the property of their respective owners.

Go standard library
Copyright 2009 The Go Authors
License – BSD 3-Clause License https://go.dev/LICENSE

golang.org/x/sys
Copyright 2009 The Go Authors
License – BSD 3-Clause License https://cs.opensource.google/go/x/sys/+/master:LICENSE