2017-02-17 15:04:32 +00:00
|
|
|
# Prometheus Postfix exporter
|
|
|
|
|
2017-05-02 13:07:19 +00:00
|
|
|
This repository provides code for a Prometheus metrics exporter
|
|
|
|
for [the Postfix mail server](http://www.postfix.org/). This exporter
|
|
|
|
provides histogram metrics for the size and age of messages stored in
|
|
|
|
the mail queue. It extracts these metrics from Postfix by connecting to
|
|
|
|
a UNIX socket under `/var/spool`.
|
|
|
|
|
2018-02-13 10:15:04 +00:00
|
|
|
In addition to that, it counts events by parsing Postfix's log entries,
|
|
|
|
using regular expression matching.
|
|
|
|
The log entries are retrieved from the systemd journal or from a log file.
|
|
|
|
|
|
|
|
Please refer to this utility's `main()` function for a list of supported
|
|
|
|
command line flags.
|
|
|
|
|
|
|
|
## Events from log file
|
|
|
|
|
|
|
|
The log file is truncated when
|
2017-05-02 13:07:19 +00:00
|
|
|
processed, so that the next iteration doesn't interpret the same lines
|
|
|
|
twice. It makes sense to configure your syslogger to multiplex log
|
|
|
|
entries to a second file:
|
|
|
|
|
|
|
|
```
|
|
|
|
mail.* -/var/log/postfix_exporter_input.log
|
|
|
|
```
|
2017-02-17 15:04:32 +00:00
|
|
|
|
2018-02-13 10:15:04 +00:00
|
|
|
The path to the log file is specified with the `-postfix.logfile_path` flag.
|
2018-02-02 10:51:33 +00:00
|
|
|
|
2018-02-13 10:15:04 +00:00
|
|
|
## Events from systemd
|
2018-02-02 10:51:33 +00:00
|
|
|
|
2018-02-13 10:15:04 +00:00
|
|
|
Retrieval from the systemd journal is enabled with the `-systemd.enable` flag.
|
|
|
|
This overrides the log file setting.
|
|
|
|
It is possible to specify the unit (with `-systemd.unit`) or slice (with `-systemd.slice`).
|
|
|
|
Additionally, it is possible to read the journal from a directory with the `-systemd.journal_path` flag.
|