From ca72dbd125701b348e819da027aaad35f611f725 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Tue, 15 Jan 2019 15:01:23 +0100 Subject: [PATCH] nixos/prometheus-dovecot-exporter: enhance `socketPath` documentation In Dovecot 2.3[1] the stats module changed and now the UNIX socket provided by Dovecot by default isn't compatible anymore with the exporter[2]. By enabling the `old-stats` plugin in Dovecot this issue can be solved which should be documented in this module. [1] https://wiki2.dovecot.org/Upgrading/2.3 [2] https://github.com/kumina/dovecot_exporter/issues/8 --- .../prometheus/exporters/dovecot.nix | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/monitoring/prometheus/exporters/dovecot.nix b/nixos/modules/services/monitoring/prometheus/exporters/dovecot.nix index 4ca6d4e5f8b6..c47e87a3dc35 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters/dovecot.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters/dovecot.nix @@ -18,12 +18,34 @@ in socketPath = mkOption { type = types.path; default = "/var/run/dovecot/stats"; - example = "/var/run/dovecot2/stats"; + example = "/var/run/dovecot2/old-stats"; description = '' Path under which the stats socket is placed. The user/group under which the exporter runs, should be able to access the socket in order to scrape the metrics successfully. + + Please keep in mind that the stats module has changed in + Dovecot 2.3+ which + is not compatible with this exporter. + + The following extra config has to be passed to Dovecot to ensure that recent versions + work with this exporter: + + { + = true; + = "/var/run/dovecot2/old-stats"; + = ''' + mail_plugins = $mail_plugins old_stats + service old-stats { + unix_listener old-stats { + user = nobody + group = nobody + } + } + '''; + } + ''; }; scopes = mkOption {