From d0b40e08ff15dd1253f6140ebbba8660be08d13b Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 26 Oct 2022 22:21:36 +0100 Subject: [PATCH 1/1] Attempt to make juniper alarms more robust --- cookbooks/prometheus/templates/default/alert_rules.yml.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbooks/prometheus/templates/default/alert_rules.yml.erb b/cookbooks/prometheus/templates/default/alert_rules.yml.erb index 417641cf0..df1329147 100644 --- a/cookbooks/prometheus/templates/default/alert_rules.yml.erb +++ b/cookbooks/prometheus/templates/default/alert_rules.yml.erb @@ -217,12 +217,12 @@ groups: - name: juniper rules: - alert: juniper fan alarm - expr: jnxOperatingState{jnxOperatingContentsIndex="4",jnxOperatingState!="running"} > 0 + expr: sum_over_time(jnxOperatingState{jnxOperatingContentsIndex="4",jnxOperatingState!="running"}[5m]) > 0 for: 5m labels: alertgroup: "{{ $labels.site }}" - alert: juniper power alarm - expr: jnxOperatingState{jnxOperatingContentsIndex="2",jnxOperatingState!="running"} > 0 + expr: sum_over_time(jnxOperatingState{jnxOperatingContentsIndex="2",jnxOperatingState!="running"}[5m]) > 0 for: 5m labels: alertgroup: "{{ $labels.site }}" -- 2.39.5