MyNixOS website logo
option

services.prometheus.exporters.dovecot.socketPath

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:

{
  services.prometheus.exporters.dovecot.enable = true;
  services.prometheus.exporters.dovecot.socketPath = "/var/run/dovecot2/old-stats";
  services.dovecot2.mailPlugins.globally.enable = [ "old_stats" ];
  services.dovecot2.extraConfig = ''
    service old-stats {
      unix_listener old-stats {
        user = dovecot-exporter
        group = dovecot-exporter
        mode = 0660
      }
      fifo_listener old-stats-mail {
        mode = 0660
        user = dovecot
        group = dovecot
      }
      fifo_listener old-stats-user {
        mode = 0660
        user = dovecot
        group = dovecot
      }
    }
    plugin {
      old_stats_refresh = 30 secs
      old_stats_track_cmds = yes
    }
  '';
}
Declarations
Type
path
Default
"/var/run/dovecot/stats"
Example
"/var/run/dovecot2/old-stats"