infrastructure/modules/nixos/dgn-node-monitoring.nix
catvayor a2ca441284
All checks were successful
Check meta / check_dns (pull_request) Successful in 18s
Check meta / check_meta (pull_request) Successful in 25s
Check workflows / check_workflows (pull_request) Successful in 26s
Build all the nodes / ap01 (pull_request) Successful in 1m7s
Build all the nodes / bridge01 (pull_request) Successful in 1m49s
Build all the nodes / geo02 (pull_request) Successful in 1m59s
Build all the nodes / geo01 (pull_request) Successful in 2m7s
Build all the nodes / rescue01 (pull_request) Successful in 2m27s
Build all the nodes / compute01 (pull_request) Successful in 2m46s
Build all the nodes / storage01 (pull_request) Successful in 2m1s
Build all the nodes / vault01 (pull_request) Successful in 1m43s
Run pre-commit on all files / check (pull_request) Successful in 34s
Build all the nodes / web02 (pull_request) Successful in 1m51s
Build all the nodes / web03 (pull_request) Successful in 1m40s
Build all the nodes / ap01 (push) Successful in 58s
Build all the nodes / web01 (pull_request) Successful in 2m37s
Build all the nodes / bridge01 (push) Successful in 1m32s
Build all the nodes / geo01 (push) Successful in 1m46s
Build all the nodes / compute01 (push) Successful in 2m6s
Build all the nodes / geo02 (push) Successful in 1m46s
Build all the nodes / rescue01 (push) Successful in 2m6s
Build all the nodes / storage01 (push) Successful in 1m54s
Run pre-commit on all files / check (push) Successful in 36s
Build all the nodes / vault01 (push) Successful in 1m52s
Build all the nodes / web01 (push) Successful in 2m25s
Build all the nodes / web02 (push) Successful in 1m44s
Build all the nodes / web03 (push) Successful in 1m46s
fix: remove lib.mdDoc references
2024-12-11 23:07:14 +01:00

57 lines
1 KiB
Nix

{
pkgs,
sources,
config,
lib,
...
}:
let
inherit (lib)
mkEnableOption
mkIf
mkOption
types
;
cfg = config.dgn-node-monitoring;
in
{
options.dgn-node-monitoring = {
enable = mkEnableOption "DGNum nodes monitoring (needs a valid netbird tunnel)" // {
default = true;
};
port = mkOption {
type = types.port;
default = 9002;
description = ''
Port to listen on.
'';
};
};
imports = [
"${sources.cgroup-exporter}/nix/module.nix"
];
config = mkIf cfg.enable {
services.prometheus = {
exporters = {
node = {
enable = true;
enabledCollectors = [
"processes"
"systemd"
];
inherit (cfg) port;
listenAddress = "0.0.0.0";
};
cgroup = {
enable = true;
package = pkgs.callPackage "${sources.cgroup-exporter}/nix/package.nix" { };
};
};
};
networking.firewall.interfaces.wt0.allowedTCPPorts = [ cfg.port ];
};
}