smartctl_exporter: Add
This commit is contained in:
parent
6a01f78adc
commit
ecc2065201
|
@ -1,4 +1,4 @@
|
|||
# SPDX-FileCopyrightText: 2021-2023 Simon Bruder <simon@sbruder.de>
|
||||
# SPDX-FileCopyrightText: 2021-2024 Simon Bruder <simon@sbruder.de>
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
|
@ -92,6 +92,8 @@
|
|||
}
|
||||
];
|
||||
|
||||
services.prometheus.exporters.smartctl.devices = [ "/dev/nvme0n1" "/dev/sda" "/dev/sdb" "/dev/sdc" ];
|
||||
|
||||
powerManagement.cpuFreqGovernor = "schedutil";
|
||||
|
||||
networking = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# SPDX-FileCopyrightText: 2020-2023 Simon Bruder <simon@sbruder.de>
|
||||
# SPDX-FileCopyrightText: 2020-2024 Simon Bruder <simon@sbruder.de>
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
|
@ -55,6 +55,8 @@
|
|||
{ device = "/dev/disk/by-uuid/98de7ced-4d7c-4915-bf5b-1a0300458ea6"; }
|
||||
];
|
||||
|
||||
services.prometheus.exporters.smartctl.devices = [ "/dev/nvme0n1" "/dev/nvme1n1" ];
|
||||
|
||||
# GPU
|
||||
hardware.opengl = {
|
||||
package = pkgs.mesa.drivers;
|
||||
|
|
|
@ -55,6 +55,8 @@
|
|||
};
|
||||
};
|
||||
|
||||
services.prometheus.exporters.smartctl.devices = [ "/dev/nvme0n1" "/dev/nvme1n1" ];
|
||||
|
||||
networking.useDHCP = false;
|
||||
networking.usePredictableInterfaceNames = false;
|
||||
systemd.network = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# SPDX-FileCopyrightText: 2021-2023 Simon Bruder <simon@sbruder.de>
|
||||
# SPDX-FileCopyrightText: 2021-2024 Simon Bruder <simon@sbruder.de>
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
|
@ -45,6 +45,8 @@
|
|||
};
|
||||
};
|
||||
|
||||
services.prometheus.exporters.smartctl.devices = [ "/dev/nvme0n1" ];
|
||||
|
||||
powerManagement = {
|
||||
cpuFreqGovernor = "schedutil";
|
||||
};
|
||||
|
|
|
@ -83,6 +83,22 @@ in
|
|||
regex = "(.*)\\.vpn\\.sbruder\\.de:9100";
|
||||
};
|
||||
}
|
||||
{
|
||||
job_name = "smartctl";
|
||||
static_configs = mkStaticTargets [
|
||||
"fuuko.vpn.sbruder.de:9633"
|
||||
"mayushii.vpn.sbruder.de:9633"
|
||||
"nunotaba.vpn.sbruder.de:9633"
|
||||
"hitagi.vpn.sbruder.de:9633"
|
||||
"shinobu.vpn.sbruder.de:9633"
|
||||
"koyomi.vpn.sbruder.de:9633"
|
||||
];
|
||||
relabel_configs = lib.singleton {
|
||||
target_label = "instance";
|
||||
source_labels = lib.singleton "__address__";
|
||||
regex = "(.*)\\.vpn\\.sbruder\\.de:9633";
|
||||
};
|
||||
}
|
||||
{
|
||||
job_name = "qbittorrent";
|
||||
static_configs = mkStaticTargets [
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
./pipewire.nix
|
||||
./podman.nix
|
||||
./prometheus/node_exporter.nix
|
||||
./prometheus/smartctl_exporter.nix
|
||||
./pubkeys.nix
|
||||
./qbittorrent
|
||||
./restic
|
||||
|
|
22
modules/prometheus/smartctl_exporter.nix
Normal file
22
modules/prometheus/smartctl_exporter.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
# SPDX-FileCopyrightText: 2020-2024 Simon Bruder <simon@sbruder.de>
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
services.prometheus.exporters.smartctl = {
|
||||
enable = config.sbruder.wireguard.home.enable && !config.sbruder.machine.isVm;
|
||||
listenAddress = config.sbruder.wireguard.home.address;
|
||||
# devices need to be specified for all systems that use NVMe
|
||||
# https://github.com/NixOS/nixpkgs/issues/210041
|
||||
};
|
||||
|
||||
systemd.services.prometheus-smartctl-exporter = {
|
||||
after = [ "wireguard-wg-home.service" ];
|
||||
serviceConfig = {
|
||||
IPAddressAllow = lib.singleton config.sbruder.wireguard.home.subnet;
|
||||
IPAddressDeny = "any";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue