7fa2e37607
See, $ gometalinter --vendor ./... postfix_exporter.go:249:⚠️ Potential file inclusion via variable,MEDIUM,HIGH (gosec) postfix_exporter.go:80:⚠️ Errors unhandled.,LOW,HIGH (gosec) postfix_exporter.go:121:⚠️ Errors unhandled.,LOW,HIGH (gosec) postfix_exporter.go:296:⚠️ Errors unhandled.,LOW,HIGH (gosec) postfix_exporter.go:298:⚠️ Errors unhandled.,LOW,HIGH (gosec) postfix_exporter.go:300:⚠️ Errors unhandled.,LOW,HIGH (gosec) postfix_exporter.go:302:⚠️ Errors unhandled.,LOW,HIGH (gosec) postfix_exporter.go:309:⚠️ Errors unhandled.,LOW,HIGH (gosec) postfix_exporter.go:311:⚠️ Errors unhandled.,LOW,HIGH (gosec) postfix_exporter.go:313:⚠️ Errors unhandled.,LOW,HIGH (gosec) postfix_exporter.go:315:⚠️ Errors unhandled.,LOW,HIGH (gosec) postfix_exporter.go:322:⚠️ Errors unhandled.,LOW,HIGH (gosec) postfix_exporter.go:324:⚠️ Errors unhandled.,LOW,HIGH (gosec) postfix_exporter.go:333:⚠️ Errors unhandled.,LOW,HIGH (gosec) postfix_exporter.go:335:⚠️ Errors unhandled.,LOW,HIGH (gosec) postfix_exporter.go:337:⚠️ Errors unhandled.,LOW,HIGH (gosec) postfix_exporter.go:339:⚠️ Errors unhandled.,LOW,HIGH (gosec) postfix_exporter.go:650:⚠️ Errors unhandled.,LOW,HIGH (gosec) |
||
---|---|---|
.gitignore | ||
build_static.sh | ||
CHANGELOG.md | ||
Dockerfile | ||
LICENSE | ||
nosystemd.go | ||
postfix_exporter.go | ||
README.md | ||
systemd.go |
Prometheus Postfix exporter
This repository provides code for a Prometheus metrics exporter
for the Postfix mail server. 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
.
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 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
The path to the log file is specified with the -postfix.logfile_path
flag.
Events from systemd
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.
Build options
Default the exporter is build with systemd journal functionality (but it is disabled at default).
Because the systemd headers are required for building with systemd, there is
an option to build the exporter without systemd. Use the build tag nosystemd
.
go build -tags nosystemd