sergeymakinen / postfix_exporter Goto Github PK
View Code? Open in Web Editor NEWExport Postfix stats to Prometheus
License: BSD 3-Clause "New" or "Revised" License
Export Postfix stats to Prometheus
License: BSD 3-Clause "New" or "Revised" License
Hello @sergeymakinen
So far, I'm running two different postfix exporters, of which only yours seems to be maintained.
In order to diagnose postfix, I'd love to see the following metrics added to your postfix exporter:
I'd like to have some more values, but I get alot of NaN values, so I guess I need to open another issue first before asking you things that the exporter already does perhaps.
PS: I updated your grafana dashboard to use vectors, and added some metrics. I'll post them if needed.
Is it possible to use it with Docker Container?
Hello,
I'm currently using https://github.com/kumina/postfix_exporter
Would you mind explaining the differences between your exporter and the above one in a couple of words ?
Best regards.
Hello Sergey,
I'm currently testing your 2.0.0-beta0 release on one of my servers.
The server has dovecot writing to /var/log/mail.log
which produces alot of "non postfix" error lines in your exporter.
ts=2023-12-26T10:24:32.242Z caller=main.go:39 level=info msg="Starting postfix_exporter" version="(version=2.0.0-beta.0, branch=HEAD, revision=91d1f51e7e5bd424c0190f4bd6ff5d004bd758d0)"
ts=2023-12-26T10:24:32.242Z caller=main.go:40 level=info msg="Build context" context="(go=go1.21.4, platform=linux/amd64, user=root@ee34a7c5589c, date=20231203-21:15:58, tags=netgo)"
ts=2023-12-26T10:24:32.242Z caller=tls_config.go:274 level=info msg="Listening on" address=[::]:9907
ts=2023-12-26T10:24:32.242Z caller=tls_config.go:277 level=info msg="TLS is disabled." http2=false address=[::]:9907
ts=2023-12-26T10:24:40.660Z caller=exporter.go:156 level=warn msg="Error parsing log record" err="missing \"[\" in \"Dec 26 11:24:40 mail dovecot: pop3-login: Login: user=<[email protected]>, method=PLAIN, rip=123.123.123.256, lip=231.231.231.256, mpid=25823, TLS, session=<hPwZF2cNLtzB/T5C>\"" record=
ts=2023-12-26T10:24:40.746Z caller=exporter.go:156 level=warn msg="Error parsing log record" err="missing \"[\" in \"Dec 26 11:24:40 mail dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=123.123.123.256, lip=231.231.231.256, mpid=25824, TLS, session=<N0kbF2cNLdzB/T5C>\"" record=
ts=2023-12-26T10:24:40.854Z caller=exporter.go:156 level=warn msg="Error parsing log record" err="missing \"[\" in \"Dec 26 11:24:40 mail dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=123.123.123.256, lip=231.231.231.256, mpid=25825, TLS, session=<ZeocF2cNL9zB/T5C>\"" record=
ts=2023-12-26T10:24:42.620Z caller=exporter.go:156 level=warn msg="Error parsing log record" err="missing \"[\" in \"Dec 26 11:24:42 mail dovecot: pop3([email protected])<25823><hPwZF2cNLtzB/T5C>: Disconnected: Logged out top=0/0, retr=10/430675, del=13/319, size=69523868\"" record=
ts=2023-12-26T10:24:43.560Z caller=exporter.go:156 level=warn msg="Error parsing log record" err="missing \"[\" in \"Dec 26 11:24:43 mail dovecot: lmtp(25736): Connect from local\"" record=
ts=2023-12-26T10:24:43.749Z caller=exporter.go:156 level=warn msg="Error parsing log record" err="missing \"[\" in \"Dec 26 11:24:43 mail dovecot: lmtp([email protected])<25736><kK/+IOupimWIZAAAYRFFHw>: sieve: msgid=<JIRA.14713.1701100651000.88bd67ae-9e6a-405b-95ee-0d9ee9a81f10.1703586255696@Atlassian.JIRA>: stored mail into mailbox 'INBOX'\"" record=
ts=2023-12-26T10:24:43.751Z caller=exporter.go:156 level=warn msg="Error parsing log record" err="missing \"[\" in \"Dec 26 11:24:43 mail dovecot: lmtp(25736): Disconnect from local: Client has quit the connection (state=READY)\"" record=
ts=2023-12-26T10:24:44.777Z caller=exporter.go:156 level=warn msg="Error parsing log record" err="missing \"[\" in \"Dec 26 11:24:44 mail dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=123.123.123.256, lip=231.231.231.256, mpid=25827, TLS, session=<dhdZF2cNMtzB/T5C>\"" record=
Perhaps you could filter out non postfix logs from the exporter to lighten it's output ?
AFAIK, all postfix logs begin with the timestamp and the word "postfix", eg:
Dec 26 11:03:06 mail postfix/lmtp[20812] ...
Dec 26 11:31:20 mail postfix/cleanup ...
Dec 26 11:32:02 mail postfix/smtps/smtpd[25531] ...
Dec 26 11:32:37 mail postfix/submission/smtpd ...
Hey,
We are trying to you use this exporter on RHEL 8.7 with postfix version 3.5.8. Our log lines look like this:
2023-11-30T22:09:43.255136+00:00 HOSTNAME IP_ADDRESS/smtpd[273137]: disconnect from abc.xyz.com[xxx.xxx.xxx.xxx] ehlo=1 mail=12 rcpt=12 data=12 rset=11 commands=48 2023-11-30T22:09:43.256146+00:00 HOSTNAME IP_ADDRESS/smtpd[275221]: disconnect from abc.xyz.com[xxx.xxx.xxx.xxx] ehlo=1 mail=20 rcpt=20 data=20 rset=19 commands=80 2023-11-30T22:09:43.268411+00:00 HOSTNAME IP_ADDRESS/smtpd[274085]: disconnect from abc.xyz.com[xxx.xxx.xxx.xxx] ehlo=1 mail=19 rcpt=19 data=19 rset=18 commands=76
We are getting the following error when running the exporter:
ts=2023-11-30T21:27:08.821Z caller=exporter.go:145 level=debug msg="Error parsing log record" err="parsing time \"2023-11-30T21:27:08.657173+00:00 HOSTNAME IP_ADDRESS/smtpd[262090]:\" as \"Jan 2 15:04:05\": cannot parse \"2023-11-30T21:27:08.657173+00:00 HOSTNAME IP_ADDRESS/smtpd[262090]:\" as \"Jan\"" ts=2023-11-30T21:27:08.821Z caller=exporter.go:145 level=debug msg="Error parsing log record" err="parsing time \"2023-11-30T21:27:08.662588+00:00 HOSTNAME postfix/cleanup[265195]:\" as \"Jan 2 15:04:05\": cannot parse \"2023-11-30T21:27:08.662588+00:00 HOSTNAME postfix/cleanup[265195]:\" as \"Jan\"" ts=2023-11-30T21:27:08.821Z caller=exporter.go:145 level=debug msg="Error parsing log record" err="parsing time \"2023-11-30T21:27:08.667535+00:00 HOSTNAME IP_ADDRESS/smtpd[262090]:\" as \"Jan 2 15:04:05\": cannot parse \"2023-11-30T21:27:08.667535+00:00 HOSTNAME IP_ADDRESS/smtpd[262090]:\" as \"Jan\""
It seems the exporter is not able to parse the timestamps correctly. We have tried this with both file collector and journald options. Any suggestions how to fix this?
Thanks in advance!
Using postfix_exporter, there are lot of missing values, which show NaN
postfix_smtp_delay_seconds{status="bounced",quantile="0.5"} NaN
postfix_smtp_delay_seconds{status="bounced",quantile="0.9"} NaN
postfix_smtp_delay_seconds{status="bounced",quantile="0.99"} NaN
postfix_smtp_delay_seconds{status="deferred",quantile="0.5"} NaN
postfix_smtp_delay_seconds{status="deferred",quantile="0.9"} NaN
postfix_smtp_delay_seconds{status="deferred",quantile="0.99"} NaN
postfix_smtp_delay_seconds{status="deliverable",quantile="0.5"} NaN
postfix_smtp_delay_seconds{status="deliverable",quantile="0.9"} NaN
postfix_smtp_delay_seconds{status="deliverable",quantile="0.99"} NaN
postfix_smtp_delay_seconds{status="undeliverable",quantile="0.5"} NaN
postfix_smtp_delay_seconds{status="undeliverable",quantile="0.9"} NaN
postfix_smtp_delay_seconds{status="undeliverable",quantile="0.99"} NaN
Also, I do not have at all any postfix_lmtp*
metrics.
Env:
postfix_exporter, version 1.2.3 (branch: HEAD, revision: 1a165a25141dd26027a1a3fec8980541b6f8b962)
build user: root@c115ac5c6c2d
build date: 20230831-21:59:00
go version: go1.20.7
platform: linux/amd64
tags: netgo
OS:
CentOS 7
postconf mail_version
mail_version = 3.5.9
I can provide anonymized mail logs if needed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.