Add smartctl monitoring

This commit is contained in:
Rodrigo Arias 2023-04-18 16:03:46 +02:00
parent 40d0a16736
commit 0f7a0c3ac2

View File

@ -21,6 +21,13 @@
metrics-addr = "127.0.0.1:9323"; metrics-addr = "127.0.0.1:9323";
}; };
# Required to allow the smartctl exporter to read the nvme0 character device,
# see the commit message on:
# https://github.com/NixOS/nixpkgs/commit/12c26aca1fd55ab99f831bedc865a626eee39f80
services.udev.extraRules = ''
SUBSYSTEM=="nvme", KERNEL=="nvme[0-9]*", GROUP="disk"
'';
services.prometheus = { services.prometheus = {
exporters = { exporters = {
@ -32,6 +39,7 @@
enabledCollectors = [ "systemd" ]; enabledCollectors = [ "systemd" ];
port = 9002; port = 9002;
}; };
smartctl.enable = true;
}; };
scrapeConfigs = [ scrapeConfigs = [
@ -43,6 +51,7 @@
"127.0.0.1:${toString config.services.prometheus.exporters.ipmi.port}" "127.0.0.1:${toString config.services.prometheus.exporters.ipmi.port}"
"127.0.0.1:9323" "127.0.0.1:9323"
"127.0.0.1:9252" "127.0.0.1:9252"
"127.0.0.1:${toString config.services.prometheus.exporters.smartctl.port}"
]; ];
}]; }];
} }