Go to file
Mario Trangoni 4d195655fd postfix_exporter.go: Fix megacheck issues
See,
$ gometalinter --vendor --deadline 10m --disable-all --enable=megacheck ./...
postfix_exporter.go:97:17⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:276:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:277:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:278:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:279:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:280:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:281:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:282:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:283:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:284:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:285:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2018-12-16 10:56:41 +01:00
.gitignore .gitignore: Exclude binary and vim editor temporary files. 2018-12-04 16:48:06 +01:00
build_static.sh build_static.sh updated to ubuntu docker container to support systemd journal usage. 2018-02-02 11:51:33 +01:00
CHANGELOG.md Update readme and changelog for release. 2018-05-04 12:22:34 +02:00
Dockerfile add Dockefile 2018-11-04 02:57:56 +01:00
LICENSE Check in an initial copy of our Postfix metrics exporter. 2017-02-17 15:29:37 +01:00
nosystemd.go Add nosystemd build tag 2018-04-19 13:34:18 +02:00
postfix_exporter.go postfix_exporter.go: Fix megacheck issues 2018-12-16 10:56:41 +01:00
README.md Update readme and changelog for release. 2018-05-04 12:22:34 +02:00
systemd.go systemd.go: Fix gosec issue. 2018-12-04 17:13:17 +01:00

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