modules/nixos/monitoring: refactor hosts
This commit is contained in:
parent
74f889bccb
commit
e3fb48904c
3 changed files with 21 additions and 28 deletions
modules/nixos/monitoring
10
modules/nixos/monitoring/hosts.nix
Normal file
10
modules/nixos/monitoring/hosts.nix
Normal 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"
|
||||
]
|
|
@ -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 = [
|
||||
|
|
|
@ -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: {
|
||||
|
|
Loading…
Add table
Reference in a new issue