Go to file
Bart Vercoulen 40c13b6ca0
Merge pull request #64 from k-kinzal/fixes-systemd-support
fixes an issue where can't get metrics in systemd journal
2021-03-12 10:52:58 +01:00
mock Adding some test for the showq part. Found a minor bug. 2020-02-24 15:42:20 +01:00
testdata Adding some test for the showq part. Found a minor bug. 2020-02-24 15:42:20 +01:00
.dockerignore Cleaning up the Dockerfile 2020-02-18 13:33:30 +01:00
.gitignore Ignoring more files 2020-02-12 13:38:03 +01:00
.travis.yml Better config for travis 2020-02-25 11:40:11 +01:00
build_static.sh Build binary with official golang image 2019-03-07 15:08:50 -08:00
CHANGELOG.md Update readme and changelog for release. 2018-05-04 12:22:34 +02:00
Dockerfile Merge remote-tracking branch 'digineo/gomod' into digineo-updates 2020-02-19 18:16:20 +01:00
go.mod ran "go mod tidy" after merge 2020-02-19 18:18:31 +01:00
go.sum added go.sum 2020-02-19 18:11:52 +01:00
LICENSE Check in an initial copy of our Postfix metrics exporter. 2017-02-17 15:29:37 +01:00
main.go #14: Removed leftover info about truncating the logfile. Also changed thhe default to maillog since that is the normal file postfix uses. 2020-02-26 11:36:35 +01:00
nosystemd.go Added extra build tags to enable testing on no-linux systems 2020-02-12 13:40:22 +01:00
postfix_exporter_test.go Fixing issue with collecting smtpdProcesses without Sasl 2020-02-24 16:44:29 +01:00
postfix_exporter.go Merge pull request #64 from k-kinzal/fixes-systemd-support 2021-03-12 10:52:58 +01:00
README.md Updated README 2020-05-15 08:24:11 -04:00
showq_test.go Adding some test for the showq part. Found a minor bug. 2020-02-24 15:42:20 +01:00
systemd.go Fixed compile failure 2020-02-18 16:56:31 +01:00

Prometheus Postfix exporter

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. It also 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.

Options

These options can be used when starting the postfix_exporter

Flag Description Default
--web.listen-address Address to listen on for web interface and telemetry 9154
--web.telemetry-path Path under which to expose metrics /metrics
--postfix.showq_path Path at which Postfix places its showq socket /var/spool/postfix/public/showq
--postfix.logfile_path Path where Postfix writes log entries /var/log/maillog
--log.unsupported Log all unsupported lines false
--systemd.enable Read from the systemd journal instead of log false
--systemd.unit Name of the Postfix systemd unit postfix.service
--systemd.slice Name of the Postfix systemd slice. ""
--systemd.journal_path Path to the systemd journal ""

Events from log file

The log file is tailed when processed. Rotating the log files while the exporter is running is OK. 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