27 lines
854 B
Nix
27 lines
854 B
Nix
# Phase 2 — not active until imported.
|
|
# Activate by:
|
|
# 1. Create hosts/AZ-CLD-1/services/monitoring/default.nix with `imports = [ ./node-exporter.nix ];`
|
|
# 2. Add `./monitoring` to hosts/AZ-CLD-1/services/default.nix imports.
|
|
#
|
|
# binds to netbird interface so PRM prometheus can scrape it over VPN.
|
|
{config, ...}: let
|
|
nodeExporterPort = config.m3ta.ports.get "node-exporter";
|
|
prmNetbirdIP = "100.91.49.26";
|
|
in {
|
|
services.prometheus.exporters.node = {
|
|
enable = true;
|
|
port = nodeExporterPort;
|
|
listenAddress = "100.91.203.184"; # CLD netbird IP — overwrite if changed
|
|
enabledCollectors = [
|
|
"systemd"
|
|
"diskstats"
|
|
"filesystem"
|
|
];
|
|
openFirewall = false;
|
|
};
|
|
|
|
networking.firewall.extraCommands = ''
|
|
iptables -A INPUT -p tcp -s ${prmNetbirdIP} --dport ${toString nodeExporterPort} -j ACCEPT
|
|
'';
|
|
}
|