Next: , Previous: , Up: Top   [Contents][Index]


6 Configuration

The module looks for file mfmod_openmetrics.conf in the system configuration directory (see sysconfdir). If the environment variable MFMOD_OPENMETRICS_CONF is defined, its value is used as the full pathname if the configuration file, instead of the default location.

The file format is described in Configuration File Syntax in GNU Mailutils Manual.

The following statements are defined:

General Configuration

Configuration: namespace string

Sets namespace prefix, a string which will be added (with an underscore) at the start of each metric name in the output.

Database Configuration

Configuration: persistent bool

If ‘true’, the metrics database will persist across restarts of mailfromd. By default the database is temporary and is deleted when mailfromd terminates. If you set the persistent mode, the default database name will be /tmp/mfmetrics.db. You can change it using the database-name configuration statement.

Configuration: database-name string

Name of the metric database file. Normally this is important only when used together with persistent on. Unless string is absolute pathname, the file will be created in /tmp. When selecting directory for the database file, be sure it is writable for the user mailfromd runs as.

Configuration: database-retry n

If the database file is in use by another process, retry opening it n times. Default value is 10.

Configuration: database-wait s

Sleep s seconds (floating-point number) between two successive attempts to open the database file. The default wait time is 0.1 second.

HTTP Server Configuration

Configuration: listen "ip:port"

Configure the ip and port to listen for HTTP requests. It can have the following forms:

listen "ip:port";

Listen on the given ip and port.

listen "ip";

Listen on the given ip, port 8080.

listen ":port";

Listen on 127.0.0.1, port port.

listen any;

Listen on the first available port on 127.0.0.1. This is for testing the module. The actual address the module is listening on for HTTP is returned by the function openmetrics_http_address.

listen none;

Disable HTTP server. This is reserved for the case when HTTP requests are handled by some third party.

The default corresponds to ‘listen "127.0.0.1:8080"’.

Configuration: access-log bool

Enable HTTP access logging. E.g.:

access-log yes;

The logs are produced on the mailfromd error stream. Each log line describes a single access and contains the following fields:

Configuration: trusted-ip cidr-list

List of trusted proxy IP addresses. This is used to determine source IP address for logging (a functionality, similar to mod_remoteip module in Apache). Any number of arguments are allowed. Each argument is parsed as a CIDR. E.g.:

trusted-ip 127.0.0.1 10.0.1.0/16;

Default is ‘127.0.0.0/8’.


Next: , Previous: , Up: Top   [Contents][Index]