Add prometheus exporter for postfix and option postfix.metrics_address
This commit is contained in:
parent
83df531b00
commit
3162809647
4 changed files with 34 additions and 0 deletions
|
|
@ -44,3 +44,4 @@ postfix:
|
|||
add_header_checks: []
|
||||
smtpd_milters: []
|
||||
non_smtpd_milters: []
|
||||
metrics_address: "127.0.0.1:9154"
|
||||
|
|
|
|||
|
|
@ -3,3 +3,6 @@
|
|||
|
||||
- name: restart saslauthd
|
||||
service: name=saslauthd state=restarted
|
||||
|
||||
- name: restart prometheus-postfix-exporter
|
||||
service: name=prometheus-postfix-exporter state=restarted
|
||||
|
|
|
|||
|
|
@ -3,6 +3,21 @@
|
|||
pkg:
|
||||
- postfix
|
||||
|
||||
- name: install prometheus postfix exporter
|
||||
apt:
|
||||
pkg:
|
||||
- prometheus-postfix-exporter
|
||||
|
||||
- name: configure prometheus postfix exporter
|
||||
template:
|
||||
src: prometheus-postfix-exporter.j2
|
||||
dest: /etc/default/prometheus-postfix-exporter
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify:
|
||||
- restart prometheus-postfix-exporter
|
||||
|
||||
- name: Install and setup utilities for LDAP
|
||||
when: postfix.ldap.enable
|
||||
block:
|
||||
|
|
|
|||
15
templates/prometheus-postfix-exporter.j2
Normal file
15
templates/prometheus-postfix-exporter.j2
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# Private log file from Postfix to read and truncate. Configured in
|
||||
# /etc/rsyslog.d/prometheus-postfix-exporter.conf
|
||||
POSTFIXLOGFILE=/var/lib/prometheus/postfix-exporter/mail.log
|
||||
|
||||
# Extra arguments for the daemon.
|
||||
ARGS='--web.listen-address {{ postfix.metrics_address }}'
|
||||
|
||||
# Prometheus-postfix-exporter supports the following options:
|
||||
# --postfix.showq_path string
|
||||
# Path at which Postfix places its showq socket.
|
||||
# (default "/var/spool/postfix/public/showq")
|
||||
# --web.listen-address string
|
||||
# Address to listen on for web interface and telemetry. (default ":9154")
|
||||
# --web.telemetry-path string
|
||||
# Path under which to expose metrics. (default "/metrics")
|
||||
Loading…
Add table
Add a link
Reference in a new issue