This commit is contained in:
Pim Kunis 2024-04-13 15:43:01 +02:00
parent 145cf2e72f
commit 3b7c72f326
31 changed files with 77 additions and 319 deletions

View file

@ -38,17 +38,12 @@ in
scrapeConfigs = lib.mkIf cfg.server.enable (
lib.attrsets.mapAttrsToList
(name: machine:
let
# TODO: should finally create my own lib...
domain = if machine.isPhysical then "hyp" else "dmz";
in
{
job_name = name;
static_configs = [{
targets = [ "${name}.${domain}:${toString config.services.prometheus.exporters.node.port}" ];
}];
})
(name: machine: {
job_name = name;
static_configs = [{
targets = [ "${name}.dmz:${toString config.services.prometheus.exporters.node.port}" ];
}];
})
machines
);
};

View file

@ -7,15 +7,11 @@ let
maxResponseTime = ms: "[RESPONSE_TIME] < ${toString ms}";
machineEndpoints = lib.attrsets.mapAttrsToList
(name: machine:
let
domain = if machine.isPhysical then "hyp" else "dmz";
in
{
name = "Host ${name}";
url = "icmp://${name}.${domain}";
conditions = [ "[RESPONSE_TIME] < 10" ];
})
(name: machine: {
name = "Host ${name}";
url = "icmp://${name}.dmz";
conditions = [ "[RESPONSE_TIME] < 10" ];
})
machines;
otherEndpoints = [