core01: generalize monitoring, open up a wgmon for external nodes
This commit is contained in:
parent
544df15eb1
commit
5f2a5ff782
1 changed files with 51 additions and 17 deletions
|
@ -1,11 +1,48 @@
|
|||
{ config, pkgs, ... }:
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
my = config.my;
|
||||
realm = "ClubReseau";
|
||||
mkChildNode = { uuid, allowFrom }: { ... }@options: ''
|
||||
[${uuid}]
|
||||
enabled = yes
|
||||
default history = 10000
|
||||
default memory mode = dbengine
|
||||
health enabled by default = auto
|
||||
allow from = ${allowFrom}
|
||||
'';
|
||||
testClusterHypervisors = lib.attrValues {
|
||||
pve01 = {
|
||||
uuid = "ff9a34ec-2bf4-4389-a01a-6e242424e675";
|
||||
allowFrom = "fd85:27e8:0fc9::2";
|
||||
};
|
||||
pve02 = {
|
||||
uuid = "ed393d76-e325-48c4-be90-3d7a1d3066ee";
|
||||
allowFrom = "fd85:27e8:0fc9::3";
|
||||
};
|
||||
pve03 = {
|
||||
uuid = "abeeab1f-d4f4-4ca7-aabb-54ff28031f82";
|
||||
allowFrom = "fd85:27e8:0fc9::4";
|
||||
};
|
||||
pve04 = {
|
||||
uuid = "ee0f7cec-86f8-4fa2-8258-f7bf4172eb4b";
|
||||
allowFrom = "fd85:27e8:0fc9::5";
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
services.netdata.enable = true;
|
||||
|
||||
networking.interfaces.wireguard.wgmon = {
|
||||
ips = [ "fd85:27e8:0fc9::1/48" ];
|
||||
|
||||
listenPort = 51820;
|
||||
|
||||
privateKeyFile = "/etc/secrets/wgmon";
|
||||
generatePrivateKeyFile = true;
|
||||
|
||||
peers = [];
|
||||
};
|
||||
|
||||
systemd.services.netdata.restartTriggers = map (v: config.environment.etc."netdata/${v}.conf".source) [
|
||||
"netdata"
|
||||
"stream"
|
||||
|
@ -27,22 +64,19 @@ in
|
|||
user = "netdata";
|
||||
group = "netdata";
|
||||
mode = "0600";
|
||||
text = ''
|
||||
# pve01 hypervisor
|
||||
[e245097d-bf52-4f66-9c10-984e8d5ee178]
|
||||
enabled = yes
|
||||
default history = 10000
|
||||
default memory mode = dbengine
|
||||
health enabled by default = auto
|
||||
allow from = 10.1.1.10
|
||||
# public-cof server
|
||||
[c48e6ef1-5cdf-408d-ae2f-86aadb14e3fe]
|
||||
enabled = yes
|
||||
default history = 10000
|
||||
default memory mode = dbengine
|
||||
health enabled by default = auto
|
||||
allow from = 10.1.1.21
|
||||
'';
|
||||
text = (concatMapStrings map (cfg: mkChildNode cfg {})
|
||||
[
|
||||
# PVE01 hypervisor
|
||||
{
|
||||
uuid = "e245097d-bf52-4f66-9c10-984e8d5ee178";
|
||||
allowFrom = "10.1.1.10";
|
||||
}
|
||||
# Public COF server
|
||||
{
|
||||
uuid = "c48e6ef1-5cdf-408d-ae2f-86aadb14e3fe";
|
||||
allowFrom = "10.1.1.21";
|
||||
}
|
||||
]; ++ testClusterHypervisors;
|
||||
};
|
||||
|
||||
environment.etc."netdata/health_alarm_notify.conf" = {
|
||||
|
|
Loading…
Reference in a new issue