From: Tom Hughes Date: Thu, 21 Jul 2022 16:39:51 +0000 (+0100) Subject: Add sensor values to cisco alerts X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/c1fa3b8ab16ee50ccb201038cf7ea675c23113a3 Add sensor values to cisco alerts --- diff --git a/cookbooks/prometheus/templates/default/alert_rules.yml.erb b/cookbooks/prometheus/templates/default/alert_rules.yml.erb index 96f7fdb02..94a2323d3 100644 --- a/cookbooks/prometheus/templates/default/alert_rules.yml.erb +++ b/cookbooks/prometheus/templates/default/alert_rules.yml.erb @@ -75,11 +75,15 @@ groups: for: 5m labels: alertgroup: "{{ $labels.site }}" + annotations: + fan_rpm: "{{ with printf \"rlPhdUnitEnvParamFan1Speed{site='%s',instance='%s',rlPhdUnitEnvParamStackUnit='%s'}\" $labels.site $labels.instance $labels.rlPhdUnitEnvParamStackUnit | query }}{{ . | first | value | humanize }}rpm{{end}}" - alert: cisco temperature alarm expr: rlPhdUnitEnvParamTempSensorStatus{rlPhdUnitEnvParamTempSensorStatus!="ok"} > 0 for: 5m labels: alertgroup: "{{ $labels.site }}" + annotations: + temp_celsius: "{{ with printf \"rlPhdUnitEnvParamTempSensorValue{site='%s',instance='%s',rlPhdUnitEnvParamStackUnit='%s'}\" $labels.site $labels.instance $labels.rlPhdUnitEnvParamStackUnit | query }}{{ . | first | value | humanize }}C{{end}}" - alert: cisco main power alarm expr: rlPhdUnitEnvParamMainPSStatus{rlPhdUnitEnvParamMainPSStatus!="normal"} > 0 for: 5m