services/monitoring: Only monitor non-dev hosts

This commit is contained in:
Moritz 'e1mo' Fromm 2023-08-12 11:03:58 +02:00
parent d7d6b7e6ef
commit 2e5d1690d4
No known key found for this signature in database
GPG key ID: 1D5D79A439E787F1

View file

@ -39,18 +39,10 @@
monDomain = "mon.${config.networking.domain}"; monDomain = "mon.${config.networking.domain}";
# deadnix: skip # Will be used as soon as we have two non-dev hosts
isMe = host: host.config.networking.fqdn == fqdn; isMe = host: host.config.networking.fqdn == fqdn;
# deadnix: skip # Will be used as soon as we have two non-dev hosts
isDev_ = getAttrFromPath [ "_module" "args" "isDev" ]; isDev_ = getAttrFromPath [ "_module" "args" "isDev" ];
allHosts = outputs.nixosConfigurations // externalTargets; allHosts = outputs.nixosConfigurations // externalTargets;
/* allTargets = filterAttrs (_: c: (isMe c) || !(isDev_ c)) allHosts;
Right now we only have one non-dev host in our NixOS setup (the ansible hosts don't monitor the NixOS hosts).
That's why we currently add all hosts to our little monitoring "cluster". As soon as we have two or more production hosts,
the dev host can be taken out of the equation
*/
# allTargets = filterAttrs (_: c: (isMe c) || !(isDev_ c)) allHosts;
allTargets = allHosts;
monTarget = service: config: "${config.networking.hostName}.${monDomain}:${toString service.port}"; monTarget = service: config: "${config.networking.hostName}.${monDomain}:${toString service.port}";
targetAllHosts = servicePath: let targetAllHosts = servicePath: let