modules/nixos/monitoring: refactor hosts

This commit is contained in:
zowoq 2023-08-14 20:41:52 +10:00
parent 74f889bccb
commit e3fb48904c
3 changed files with 21 additions and 28 deletions
modules/nixos/monitoring

View file

@ -0,0 +1,10 @@
[
"build01.nix-community.org"
"build02.nix-community.org"
"build03.nix-community.org"
"build04.nix-community.org"
"darwin02.nix-community.org"
"darwin03.nix-community.org"
"web01.nix-community.org"
#"web02.nix-community.org"
]

View file

@ -18,23 +18,16 @@
job_name = "telegraf";
scrape_interval = "60s";
metrics_path = "/metrics";
static_configs = [
{
targets = map (host: "${host}:9273")
[
"build01.nix-community.org"
"build02.nix-community.org"
"build03.nix-community.org"
"build04.nix-community.org"
"darwin02.nix-community.org"
"darwin03.nix-community.org"
"web01.nix-community.org"
#"web02.nix-community.org"
"localhost"
];
labels.org = "nix-community";
}
];
static_configs =
let
hosts = import ./hosts.nix;
in
[
{
targets = map (host: "${host}:9273") hosts ++ [ "localhost:9273" ];
labels.org = "nix-community";
}
];
}
];
alertmanagers = [

View file

@ -28,17 +28,7 @@
];
net_response =
let
hosts = [
"build01.nix-community.org"
"build02.nix-community.org"
"build03.nix-community.org"
"build04.nix-community.org"
"darwin01.nix-community.org"
"darwin02.nix-community.org"
"darwin03.nix-community.org"
"web01.nix-community.org"
#"web02.nix-community.org"
];
hosts = import ./hosts.nix;
in
map
(host: {