forked from pub-solar/infra
Compare commits
12 commits
563aa9ef46
...
37f9419aef
Author | SHA1 | Date | |
---|---|---|---|
Pablo Ovelleiro Corral | 37f9419aef | ||
teutat3s | b6be95d032 | ||
teutat3s | 99308bfe24 | ||
teutat3s | 50eb1d4f32 | ||
teutat3s | c0fcf2352f | ||
teutat3s | 3708d77d9b | ||
teutat3s | 7f2bfd923f | ||
teutat3s | 30d18c725a | ||
teutat3s | 387d97a2ea | ||
teutat3s | 6f2eeeb99e | ||
teutat3s | 21a28e1212 | ||
teutat3s | c3bf5df1d8 |
|
@ -20,41 +20,8 @@ indent_style = unset
|
||||||
indent_size = unset
|
indent_size = unset
|
||||||
|
|
||||||
[{.*,secrets}/**]
|
[{.*,secrets}/**]
|
||||||
end_of_line = unset
|
end_of_line = false
|
||||||
insert_final_newline = unset
|
insert_final_newline = false
|
||||||
trim_trailing_whitespace = unset
|
|
||||||
charset = unset
|
|
||||||
indent_style = unset
|
|
||||||
indent_size = unset
|
|
||||||
|
|
||||||
[*.rom]
|
|
||||||
end_of_line = unset
|
|
||||||
insert_final_newline = unset
|
|
||||||
trim_trailing_whitespace = unset
|
|
||||||
charset = unset
|
|
||||||
indent_style = unset
|
|
||||||
indent_size = unset
|
|
||||||
|
|
||||||
[*.py]
|
|
||||||
indent_size = 4
|
|
||||||
|
|
||||||
[*.md]
|
|
||||||
max_line_length = off
|
|
||||||
trim_trailing_whitespace = false
|
|
||||||
|
|
||||||
# Ignore diffs/patches
|
|
||||||
[*.{diff,patch}]
|
|
||||||
end_of_line = unset
|
|
||||||
insert_final_newline = unset
|
|
||||||
trim_trailing_whitespace = unset
|
|
||||||
indent_size = unset
|
|
||||||
charset = unset
|
|
||||||
indent_style = unset
|
|
||||||
indent_size = unset
|
|
||||||
|
|
||||||
[{.*,secrets}/**]
|
|
||||||
end_of_line = unset
|
|
||||||
insert_final_newline = unset
|
|
||||||
trim_trailing_whitespace = unset
|
trim_trailing_whitespace = unset
|
||||||
charset = unset
|
charset = unset
|
||||||
indent_style = unset
|
indent_style = unset
|
||||||
|
|
44
flake.lock
44
flake.lock
|
@ -14,11 +14,11 @@
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720546205,
|
"lastModified": 1723293904,
|
||||||
"narHash": "sha256-boCXsjYVxDviyzoEyAk624600f3ZBo/DKtUdvMTpbGY=",
|
"narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=",
|
||||||
"owner": "ryantm",
|
"owner": "ryantm",
|
||||||
"repo": "agenix",
|
"repo": "agenix",
|
||||||
"rev": "de96bd907d5fbc3b14fc33ad37d1b9a3cb15edc6",
|
"rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -165,11 +165,11 @@
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1719994518,
|
"lastModified": 1722555600,
|
||||||
"narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
|
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
|
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -299,11 +299,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720599442,
|
"lastModified": 1724299755,
|
||||||
"narHash": "sha256-jdm+sKVbBXoyrxcHbVaV0htlpq2iFR+eJw3Xe/DPcDo=",
|
"narHash": "sha256-P5zMA17kD9tqiqMuNXwupkM7buM3gMNtoZ1VuJTRDE4=",
|
||||||
"owner": "lnl7",
|
"owner": "lnl7",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "cf297a8d248db6a455b60133f6c0029c04ebe50e",
|
"rev": "a8968d88e5a537b0491f68ce910749cd870bdbef",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -315,11 +315,11 @@
|
||||||
},
|
},
|
||||||
"nixos-flake": {
|
"nixos-flake": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720281493,
|
"lastModified": 1721140942,
|
||||||
"narHash": "sha256-Lic3N1H2k5RsYDtfbmfO+9K2u7uwyXIj+aCaTj2/zSY=",
|
"narHash": "sha256-iEqZGdnkG+Hm0jZhS59NJwEyB6z9caVnudWPGHZ/FAE=",
|
||||||
"owner": "srid",
|
"owner": "srid",
|
||||||
"repo": "nixos-flake",
|
"repo": "nixos-flake",
|
||||||
"rev": "cab6539d198792f94fbac029e5a63523604fd172",
|
"rev": "5734c1d9a5fe0bc8e8beaf389ad6227392ca0108",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -330,11 +330,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720691131,
|
"lastModified": 1724242322,
|
||||||
"narHash": "sha256-CWT+KN8aTPyMIx8P303gsVxUnkinIz0a/Cmasz1jyIM=",
|
"narHash": "sha256-HMpK7hNjhEk4z5SFg5UtxEio9OWFocHdaQzCfW1pE7w=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a046c1202e11b62cbede5385ba64908feb7bfac4",
|
"rev": "224042e9a3039291f22f4f2ded12af95a616cca0",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -362,14 +362,14 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-lib": {
|
"nixpkgs-lib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1719876945,
|
"lastModified": 1722555339,
|
||||||
"narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=",
|
"narHash": "sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q=",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
|
"url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
|
"url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
|
@ -519,11 +519,11 @@
|
||||||
},
|
},
|
||||||
"unstable": {
|
"unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720542800,
|
"lastModified": 1724224976,
|
||||||
"narHash": "sha256-ZgnNHuKV6h2+fQ5LuqnUaqZey1Lqqt5dTUAiAnqH0QQ=",
|
"narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "feb2849fdeb70028c70d73b848214b00d324a497",
|
"rev": "c374d94f1536013ca8e92341b540eba4c22f9c62",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
replication_factor = 1;
|
replication_factor = 1;
|
||||||
path_prefix = "/var/lib/loki";
|
path_prefix = "/data/loki";
|
||||||
storage = {
|
storage = {
|
||||||
filesystem = {
|
filesystem = {
|
||||||
chunks_directory = "chunks/";
|
chunks_directory = "chunks/";
|
||||||
|
|
|
@ -198,10 +198,10 @@ lib.mapAttrsToList
|
||||||
description = "{{$labels.instance}}: healtcheck {{$labels.job}} fails!";
|
description = "{{$labels.instance}}: healtcheck {{$labels.job}} fails!";
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
#cert_expiry = {
|
cert_expiry = {
|
||||||
# condition = "(probe_ssl_earliest_cert_expiry - time())/(3600*24) < 30";
|
condition = "(probe_ssl_earliest_cert_expiry - time())/(3600*24) < 30";
|
||||||
# description = "{{$labels.instance}}: The TLS certificate will expire in less than 30 days: {{$value}}s";
|
description = "{{$labels.instance}}: The TLS certificate will expire in less than 30 days: {{$value}}s";
|
||||||
#};
|
};
|
||||||
|
|
||||||
# ignore devices that disabled S.M.A.R.T (example if attached via USB)
|
# ignore devices that disabled S.M.A.R.T (example if attached via USB)
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
flake,
|
flake,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
|
# TODO add hosts here
|
||||||
|
blackboxTargets = [ "https://pablo.tools" ];
|
||||||
|
in
|
||||||
{
|
{
|
||||||
age.secrets.alertmanager-envfile = {
|
age.secrets.alertmanager-envfile = {
|
||||||
file = "${flake.self}/secrets/alertmanager-envfile.age";
|
file = "${flake.self}/secrets/alertmanager-envfile.age";
|
||||||
|
@ -27,6 +31,33 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
port = 9001;
|
port = 9001;
|
||||||
exporters = {
|
exporters = {
|
||||||
|
blackbox = {
|
||||||
|
enable = true;
|
||||||
|
# Default port is 9115
|
||||||
|
# Listen on 0.0.0.0, bet we only open the firewall for wg0
|
||||||
|
openFirewall = false;
|
||||||
|
|
||||||
|
configFile = pkgs.writeTextFile {
|
||||||
|
name = "blackbox-exporter-config";
|
||||||
|
text = ''
|
||||||
|
modules:
|
||||||
|
http_2xx:
|
||||||
|
prober: http
|
||||||
|
timeout: 5s
|
||||||
|
http:
|
||||||
|
valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
|
||||||
|
valid_status_codes: [] # Defaults to 2xx
|
||||||
|
method: GET
|
||||||
|
no_follow_redirects: false
|
||||||
|
fail_if_ssl: false
|
||||||
|
fail_if_not_ssl: false
|
||||||
|
tls_config:
|
||||||
|
insecure_skip_verify: false
|
||||||
|
preferred_ip_protocol: "ip4" # defaults to "ip6"
|
||||||
|
ip_protocol_fallback: true # fallback to "ip6"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
node = {
|
node = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enabledCollectors = [ "systemd" ];
|
enabledCollectors = [ "systemd" ];
|
||||||
|
@ -38,6 +69,30 @@
|
||||||
scrape_timeout = "9s";
|
scrape_timeout = "9s";
|
||||||
};
|
};
|
||||||
scrapeConfigs = [
|
scrapeConfigs = [
|
||||||
|
{
|
||||||
|
job_name = "blackbox";
|
||||||
|
scrape_interval = "2m";
|
||||||
|
metrics_path = "/probe";
|
||||||
|
params = {
|
||||||
|
module = [ "http_2xx" ];
|
||||||
|
};
|
||||||
|
static_configs = [ { targets = blackboxTargets; } ];
|
||||||
|
|
||||||
|
relabel_configs = [
|
||||||
|
{
|
||||||
|
source_labels = [ "__address__" ];
|
||||||
|
target_label = "__param_target";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
source_labels = [ "__param_target" ];
|
||||||
|
target_label = "instance";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
target_label = "__address__";
|
||||||
|
replacement = "127.0.0.1:9115"; # The blackbox exporter's real hostname:port.
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
{
|
{
|
||||||
job_name = "node-exporter";
|
job_name = "node-exporter";
|
||||||
static_configs = [
|
static_configs = [
|
||||||
|
|
Loading…
Reference in a new issue