monitoring: scrape blackbox every 5m, alert 21 days

before certificate expiry
This commit is contained in:
teutat3s 2024-08-26 13:43:05 +02:00
parent d2806156c9
commit 84e2b22771
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
2 changed files with 3 additions and 4 deletions

View file

@ -199,8 +199,8 @@ lib.mapAttrsToList
}; };
*/ */
cert_expiry = { cert_expiry = {
condition = "(probe_ssl_earliest_cert_expiry - time())/(3600*24) < 30"; condition = "(probe_ssl_earliest_cert_expiry - time())/(3600*24) < 21";
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 21 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)

View file

@ -46,7 +46,6 @@ in
blackbox = { blackbox = {
enable = true; enable = true;
# Default port is 9115 # Default port is 9115
# Listen on 0.0.0.0, bet we only open the firewall for wg0
openFirewall = false; openFirewall = false;
configFile = pkgs.writeTextFile { configFile = pkgs.writeTextFile {
@ -83,7 +82,7 @@ in
scrapeConfigs = [ scrapeConfigs = [
{ {
job_name = "blackbox"; job_name = "blackbox";
scrape_interval = "2m"; scrape_interval = "5m";
metrics_path = "/probe"; metrics_path = "/probe";
params = { params = {
module = [ "http_2xx" ]; module = [ "http_2xx" ];