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";
|
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 = [
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue