feat: monitoring, add logistics node

This commit is contained in:
Kat Inskip 2024-05-17 15:38:54 -07:00 committed by arcnmx
parent c4ec521df2
commit b8f501d0db
11 changed files with 476 additions and 0 deletions

View file

@ -0,0 +1,53 @@
{ config, lib, ... }: let
inherit (lib.modules) mkIf mkMerge;
in {
config = {
services.prometheus.exporters = {
node = mkMerge [
{
#enable = true;
port = 9091;
enabledCollectors = [
"nfs"
];
}
(mkIf config.services.nfs.server.enable {
enabledCollectors = [
"nfsd"
];
})
(mkIf (!config.boot.isContainer) {
enabledCollectors = [
"nvme"
"hwmon"
];
})
{
enabledCollectors = [
"arp"
"boottime"
"cpu"
"cpufreq"
"diskstats"
"dmi"
"entropy"
"filesystem"
"netdev"
"systemd"
"sysctl"
"systemd"
"loadavg"
"meminfo"
"netstat"
"os"
"stat"
"time"
"uname"
"vmstat"
"zfs"
];
}
];
};
};
}

View file

@ -0,0 +1,19 @@
{ config, lib, ... }: let
inherit (builtins) toJSON;
inherit (lib.options) mkOption;
inherit (lib.types) port;
cfg = config.services.promtail;
in {
options.services.promtail.settings = {
httpListenPort = mkOption {
type = port;
description = "Port to listen on over HTTP";
default = 9094;
};
};
config.services.promtail = {
extraFlags = [
"--server.http-listen-port=${cfg.settings.httpListenPort}"
];
};
}