parent
4316c84b9d
commit
568c9718b7
3 changed files with 64 additions and 1 deletions
nixos/boxes/bolty
|
@ -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
|
||||
|
|
|
@ -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" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
28
nixos/boxes/bolty/prometheus-server.nix
Normal file
28
nixos/boxes/bolty/prometheus-server.nix
Normal 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}"];
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
Loading…
Add table
Reference in a new issue