git.iko.soy/typeable/nixpkgs
on master help sign in
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

commitca72dbd125701b348e819da027aaad35f611f725 authorMaximilian Bosch <maximilian@mbosch.me> dateTue 15 Jan 2019, 15:01 (8 years ago) parent15d8f83
1 file changed+23−1
nixos/modules/services/monitoring/prometheus/exporters/dovecot.nix+23−1
nixos/modules/services/monitoring/prometheus/exporters/dovecot.nix+23−1
@@ -18,12 +18,34 @@ in
1818 socketPath = mkOption {
1919 type = types.path;
2020 default = "/var/run/dovecot/stats";
21− example = "/var/run/dovecot2/stats";
21+ example = "/var/run/dovecot2/old-stats";
2222 description = ''
2323 Path under which the stats socket is placed.
2424 The user/group under which the exporter runs,
2525 should be able to access the socket in order
2626 to scrape the metrics successfully.
27+
28+ Please keep in mind that the stats module has changed in
29+ <link xlink:href="https://wiki2.dovecot.org/Upgrading/2.3">Dovecot 2.3+</link> which
30+ is not <link xlink:href="https://github.com/kumina/dovecot_exporter/issues/8">compatible with this exporter</link>.
31+
32+ The following extra config has to be passed to Dovecot to ensure that recent versions
33+ work with this exporter:
34+ <programlisting>
35+ {
36+ <xref linkend="opt-services.prometheus.exporters.dovecot.enable" /> = true;
37+ <xref linkend="opt-services.prometheus.exporters.dovecot.socketPath" /> = "/var/run/dovecot2/old-stats";
38+ <xref linkend="opt-services.dovecot2.extraConfig" /> = '''
39+ mail_plugins = $mail_plugins old_stats
40+ service old-stats {
41+ unix_listener old-stats {
42+ user = nobody
43+ group = nobody
44+ }
45+ }
46+ ''';
47+ }
48+ </programlisting>
2749 '';
2850 };
2951 scopes = mkOption {