mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
prometheus-rasdaemon-exporter: init at unstable-2023-03-15 (#366417)
This commit is contained in:
commit
2be7ba76d8
3 changed files with 111 additions and 0 deletions
|
@ -76,6 +76,7 @@ let
|
|||
"process"
|
||||
"pve"
|
||||
"py-air-control"
|
||||
"rasdaemon"
|
||||
"redis"
|
||||
"restic"
|
||||
"rspamd"
|
||||
|
|
|
@ -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
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
43
pkgs/by-name/pr/prometheus-rasdaemon-exporter/package.nix
Normal file
43
pkgs/by-name/pr/prometheus-rasdaemon-exporter/package.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
lib,
|
||||
python3Packages,
|
||||
fetchFromGitHub,
|
||||
}:
|
||||
|
||||
python3Packages.buildPythonApplication {
|
||||
pname = "prometheus-rasdaemon-exporter";
|
||||
version = "unstable-2023-03-15";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "sanecz";
|
||||
repo = "prometheus-rasdaemon-exporter";
|
||||
rev = "e37084edeb4d397dd360298cb22f18f83a35ff46";
|
||||
hash = "sha256-O0Zzog+5jDixFRGbqmjPYi6JDpHbxpU4hKfsqTnexS8=";
|
||||
};
|
||||
|
||||
build-system = with python3Packages; [
|
||||
setuptools
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
env.SETUPTOOLS_SCM_PRETEND_VERSION = "0.1.dev9+ge37084e";
|
||||
|
||||
dependencies = with python3Packages; [
|
||||
prometheus-client
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"prometheus_rasdaemon_exporter"
|
||||
];
|
||||
|
||||
doCheck = false; # no tests
|
||||
|
||||
meta = {
|
||||
description = "Rasdaemon exporter for Prometheus";
|
||||
homepage = "https://github.com/sanecz/prometheus-rasdaemon-exporter";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ hexa ];
|
||||
mainProgram = "prometheus-rasdaemon-exporter";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue