mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-11 21:06:19 +03:00
Merge pull request #39165 from WilliButz/update-postfix-exporter
prometheus-postfix-exporter: 2017-06-01 -> 0.1.1, update module
This commit is contained in:
commit
d65a6cc6c9
3 changed files with 76 additions and 17 deletions
|
@ -32,6 +32,33 @@ in
|
|||
Path where Postfix places it's showq socket.
|
||||
'';
|
||||
};
|
||||
systemd = {
|
||||
enable = mkEnableOption ''
|
||||
reading metrics from the systemd-journal instead of from a logfile
|
||||
'';
|
||||
unit = mkOption {
|
||||
type = types.str;
|
||||
default = "postfix.service";
|
||||
description = ''
|
||||
Name of the postfix systemd unit.
|
||||
'';
|
||||
};
|
||||
slice = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
Name of the postfix systemd slice.
|
||||
This overrides the <option>systemd.unit</option>.
|
||||
'';
|
||||
};
|
||||
journalPath = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
default = null;
|
||||
description = ''
|
||||
Path to the systemd journal.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
serviceOpts = {
|
||||
serviceConfig = {
|
||||
|
@ -39,7 +66,15 @@ in
|
|||
${pkgs.prometheus-postfix-exporter}/bin/postfix_exporter \
|
||||
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
|
||||
--web.telemetry-path ${cfg.telemetryPath} \
|
||||
${concatStringsSep " \\\n " cfg.extraFlags}
|
||||
--postfix.showq_path ${cfg.showqPath} \
|
||||
${concatStringsSep " \\\n " (cfg.extraFlags
|
||||
++ optional cfg.systemd.enable "--systemd.enable"
|
||||
++ optional cfg.systemd.enable (if cfg.systemd.slice != null
|
||||
then "--systemd.slice ${cfg.systemd.slice}"
|
||||
else "--systemd.unit ${cfg.systemd.unit}")
|
||||
++ optional (cfg.systemd.enable && (cfg.systemd.journalPath != null))
|
||||
"--systemd.jounal_path ${cfg.systemd.journalPath}"
|
||||
++ optional (!cfg.systemd.enable) "--postfix.logfile_path ${cfg.logfilePath}")}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue