re-enable stats on bolty

This commit is contained in:
Cyryl Płotnicki 2025-03-16 22:38:09 +00:00
parent 4316c84b9d
commit 568c9718b7
3 changed files with 64 additions and 1 deletions

View file

@ -17,6 +17,8 @@
./networking.nix
./nix-store-server.nix
./print-server.nix
./prometheus-node.nix
./prometheus-server.nix
./real-hardware.nix
./restic-server.nix
./syncthing.nix

View file

@ -7,6 +7,39 @@
networking.firewall.allowedTCPPorts = [9100];
services.prometheus = {
enable = true;
exporters.node.enable = true;
exporters.node = {
enable = true;
enabledCollectors = [
"arp"
"bonding"
"conntrack"
"cpu"
"disable-defaults"
"diskstats"
"entropy"
"filefd"
"filesystem"
"hwmon"
"loadavg"
"logind"
"mdadm"
"meminfo"
"netclass"
"netdev"
"netstat"
"pressure"
"sockstat"
"systemd"
"textfile"
"time"
"vmstat"
"wifi"
"zfs"
];
};
exporters.smartctl ={
enable = true;
devices = [ "/dev/sda" "/dev/sdb" "/dev/sdc" "/dev/nvme0n1" ];
};
};
}

View file

@ -0,0 +1,28 @@
{
config,
pkgs,
lib,
...
}:
{
networking.firewall.allowedTCPPorts = [ config.services.prometheus.port ];
services.prometheus = {
enable = true;
globalConfig.scrape_interval = "1m";
scrapeConfigs = [
{
job_name = "node";
static_configs = [{
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.node.port}"];
}];
}
{
job_name = "smartctl";
static_configs = [{
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.smartctl.port}"];
}];
}
];
};
}