Skip to content

Commit

Permalink
nixos/prometheux-exporters/rasdaemon: init
Browse files Browse the repository at this point in the history
(cherry picked from commit f6f1feb)
  • Loading branch information
mweinelt authored and github-actions[bot] committed Dec 19, 2024
1 parent 1973dec commit 263aec7
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/modules/services/monitoring/prometheus/exporters.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ let
"process"
"pve"
"py-air-control"
"rasdaemon"
"redis"
"restic"
"rspamd"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
config,
lib,
pkgs,
utils,
...
}:

let
inherit (lib)
getExe
mkOption
types
;

inherit (utils) escapeSystemdExecArgs;

cfg = config.services.prometheus.exporters.rasdaemon;
in
{
port = 10029;
extraOpts = with types; {
databasePath = mkOption {
type = path;
default = "/var/lib/rasdaemon/ras-mc_event.db";
description = ''
Path to the RAS daemon machine check event database.
'';
};

enabledCollectors = mkOption {
type = listOf (enum [
"aer"
"mce"
"mc"
"extlog"
"devlink"
"disk"
]);
default = [
"aer"
"mce"
"mc"
];
description = ''
List of error types to collect from the event database.
'';
};
};
serviceOpts = {
serviceConfig = {
ExecStart = escapeSystemdExecArgs (
[
(getExe pkgs.prometheus-rasdaemon-exporter)
"--address"
cfg.listenAddress
"--port"
(toString cfg.port)
"--db"
cfg.databasePath
]
++ map (collector: "--collector-${collector}") cfg.enabledCollectors
++ cfg.extraFlags
);
};
};
}

0 comments on commit 263aec7

Please sign in to comment.