Skip to content

Commit

Permalink
Merge pull request 'fix: cert_expiry prom rule fixed in prom-linuxaid…
Browse files Browse the repository at this point in the history
…, since pushprox is depcrecated now' (#374) from probe_ssl_alert into master

Reviewed-on: https://gitea.obmondo.com/EnableIT/KubeAid/pulls/374
  • Loading branch information
aman committed Aug 26, 2024
2 parents 00e1c08 + 6406970 commit 7c970c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions argocd-helm-charts/prometheus-linuxaid/rules/cert_expiry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ groups:
rules:
- alert: monitor::domains::cert_expiry
expr: |
probe_ssl_earliest_cert_expiry - time() < ignoring(instance, job, pushprox_target) 86400 * threshold::monitor::domains::cert_expiry_days
probe_ssl_earliest_cert_expiry - time() < on (certname, domain) 86400 * threshold::monitor::domains::cert_expiry_days
and on(certname) obmondo_monitoring{alert_id="monitor::domains::cert_expiry"} > 0
labels:
severity: critical
alert_id: monitor::domains::cert_expiry
annotations:
summary: "SSL certificate will expire soon for domain **{{ $labels.domain }}**"
description: SSL Certificate which is on {{ $labels.certname }} expires in {{ .Value | humanizeDuration }}
description: Blackbox exporter on {{ $labels.certname }}, domain {{ $labels.domain }} certificate expires in {{ .Value | humanizeDuration }}
20 changes: 10 additions & 10 deletions argocd-helm-charts/prometheus-linuxaid/tests/cert_expiry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ rule_files:
tests:
- interval: 1d
input_series:
- series: obmondo_monitoring{certname="jaina.enableit", alert_id="monitor::domains::cert_expiry"}
- series: obmondo_monitoring{certname="dev01.example", alert_id="monitor::domains::cert_expiry"}
values: 1x1000
- series: probe_ssl_earliest_cert_expiry{domain="obmondo.com",certname="jaina.enableit"}
- series: probe_ssl_earliest_cert_expiry{domain="example.com",certname="dev01.example"}
values: 1036800x100 # Tuesday, January 13, 1970 12:00:00 AM
- series: threshold::monitor::domains::cert_expiry_days{domain="obmondo.com",certname="jaina.enableit"}
- series: threshold::monitor::domains::cert_expiry_days{domain="example.com",certname="dev01.example"}
values: 10x100 # Alert before 10 days
- series: obmondo_monitoring{certname="jacen.enableit", alert_id="monitor::domains::cert_expiry"}
- series: obmondo_monitoring{certname="dev02.example", alert_id="monitor::domains::cert_expiry"}
values: 0x1000
- series: probe_ssl_earliest_cert_expiry{domain="obmondo.com",certname="jacen.enableit"}
- series: probe_ssl_earliest_cert_expiry{domain="example.com",certname="dev02.example"}
values: 1036800x100 # Tuesday, January 13, 1970 12:00:00 AM
- series: threshold::monitor::domains::cert_expiry_days{domain="obmondo.com",certname="jacen.enableit"}
- series: threshold::monitor::domains::cert_expiry_days{domain="example.com",certname="dev02.example"}
values: 10x100 # Alert before 10 days

alert_rule_test:
Expand All @@ -26,12 +26,12 @@ tests:
exp_alerts:
- exp_labels:
severity: critical
certname: jaina.enableit
certname: dev01.example
alert_id: monitor::domains::cert_expiry
domain: obmondo.com
domain: example.com
exp_annotations:
summary: "SSL certificate will expire soon for domain **obmondo.com**"
description: SSL Certificate which is on jaina.enableit expires in 4d 0h 0m 0s
summary: "SSL certificate will expire soon for domain **example.com**"
description: Blackbox exporter on dev01.example, domain example.com certificate expires in 4d 0h 0m 0s
# certificate still has more then 11 days to expire, and we alert if its
# less then 10 days (given by threshold)
- alertname: monitor::domains::cert_expiry
Expand Down

0 comments on commit 7c970c3

Please sign in to comment.