monitoring: remove duplicate rules from blackbox.nix
All checks were successful
Run nix flake check / flake-check (push) Successful in 2m7s

The rules were already added to rules.yml but the blackbox.nix file
still had them, causing duplicate 'groups' key errors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-09 22:28:42 +01:00
parent 8e1753c2c8
commit 4d32707130

View File

@@ -42,9 +42,9 @@ in
''; '';
}; };
# Add blackbox scrape config and alert rules to Prometheus # Add blackbox scrape config to Prometheus
services.prometheus = { # Alert rules are in rules.yml (certificate_rules group)
scrapeConfigs = [ services.prometheus.scrapeConfigs = [
{ {
job_name = "blackbox_tls"; job_name = "blackbox_tls";
metrics_path = "/probe"; metrics_path = "/probe";
@@ -73,37 +73,4 @@ in
]; ];
} }
]; ];
rules = [
''
groups:
- name: certificate_rules
rules:
- alert: tls_certificate_expiring_soon
expr: (probe_ssl_earliest_cert_expiry - time()) < 86400 * 7
for: 1h
labels:
severity: warning
annotations:
summary: "TLS certificate expiring soon on {{ $labels.instance }}"
description: "The TLS certificate for {{ $labels.instance }} expires in less than 7 days."
- alert: tls_certificate_expiring_critical
expr: (probe_ssl_earliest_cert_expiry - time()) < 86400
for: 0m
labels:
severity: critical
annotations:
summary: "TLS certificate expiring within 24h on {{ $labels.instance }}"
description: "The TLS certificate for {{ $labels.instance }} expires in less than 24 hours. Immediate action required."
- alert: tls_probe_failed
expr: probe_success{job="blackbox_tls"} == 0
for: 5m
labels:
severity: warning
annotations:
summary: "TLS probe failed for {{ $labels.instance }}"
description: "Cannot connect to {{ $labels.instance }} to check TLS certificate. The service may be down or unreachable."
''
];
};
} }