Merge pull request #9 from silkeh/systemd-readme
Document systemd usage
This commit is contained in:
commit
b1025cf55f
21
README.md
21
README.md
@ -6,8 +6,16 @@ provides histogram metrics for the size and age of messages stored in
|
|||||||
the mail queue. It extracts these metrics from Postfix by connecting to
|
the mail queue. It extracts these metrics from Postfix by connecting to
|
||||||
a UNIX socket under `/var/spool`.
|
a UNIX socket under `/var/spool`.
|
||||||
|
|
||||||
In addition to that, it counts events by parsing Postfix's log file,
|
In addition to that, it counts events by parsing Postfix's log entries,
|
||||||
using regular expression matching. It truncates the log file when
|
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
|
||||||
processed, so that the next iteration doesn't interpret the same lines
|
processed, so that the next iteration doesn't interpret the same lines
|
||||||
twice. It makes sense to configure your syslogger to multiplex log
|
twice. It makes sense to configure your syslogger to multiplex log
|
||||||
entries to a second file:
|
entries to a second file:
|
||||||
@ -16,8 +24,11 @@ entries to a second file:
|
|||||||
mail.* -/var/log/postfix_exporter_input.log
|
mail.* -/var/log/postfix_exporter_input.log
|
||||||
```
|
```
|
||||||
|
|
||||||
There is also an option to collect the metrics via the systemd journal instead of a log file.
|
The path to the log file is specified with the `-postfix.logfile_path` flag.
|
||||||
|
|
||||||
|
## Events from systemd
|
||||||
|
|
||||||
Please refer to this utility's `main()` function for a list of supported
|
Retrieval from the systemd journal is enabled with the `-systemd.enable` flag.
|
||||||
command line flags.
|
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.
|
||||||
|
Loading…
Reference in New Issue
Block a user