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"; job_name = "telegraf";
scrape_interval = "60s"; scrape_interval = "60s";
metrics_path = "/metrics"; metrics_path = "/metrics";
static_configs = [ static_configs =
{ let
targets = map (host: "${host}:9273") hosts = import ./hosts.nix;
[ in
"build01.nix-community.org" [
"build02.nix-community.org" {
"build03.nix-community.org" targets = map (host: "${host}:9273") hosts ++ [ "localhost:9273" ];
"build04.nix-community.org" labels.org = "nix-community";
"darwin02.nix-community.org" }
"darwin03.nix-community.org" ];
"web01.nix-community.org"
#"web02.nix-community.org"
"localhost"
];
labels.org = "nix-community";
}
];
} }
]; ];
alertmanagers = [ alertmanagers = [

View file

@ -28,17 +28,7 @@
]; ];
net_response = net_response =
let let
hosts = [ hosts = import ./hosts.nix;
"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"
];
in in
map map
(host: { (host: {