Merge pull request #156998 from mweinelt/smartctl-exporter-fixups

prometheus.exporters.smartctl: fixes
This commit is contained in:
ajs124 2022-01-27 18:49:49 +01:00 committed by GitHub
commit 47a2176ec8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,8 @@ in {
[ "/dev/sda", "/dev/nvme0n1" ];
'';
description = ''
Paths to disks that will be monitored.
Paths to the disks that will be monitored. Will autodiscover
all disks if none given.
'';
};
maxInterval = mkOption {
@ -41,13 +42,23 @@ in {
serviceOpts = {
serviceConfig = {
AmbientCapabilities = [
"CAP_RAW_SYSIO"
"CAP_SYS_ADMIN"
];
CapabilityBoundingSet = [
"CAP_RAW_SYSIO"
"CAP_SYS_ADMIN"
];
DevicePolicy = "closed";
DeviceAllow = lib.mkForce cfg.devices;
DeviceAllow = lib.mkOverride 100 (
if cfg.devices != [] then
cfg.devices
else [
"block-blkext rw"
"block-sd rw"
"char-nvme rw"
]
);
ExecStart = ''
${pkgs.prometheus-smartctl-exporter}/bin/smartctl_exporter -config ${configFile}
'';