]> git.openstreetmap.org Git - chef.git/commitdiff
Add sensor values to cisco alerts
authorTom Hughes <tom@compton.nu>
Thu, 21 Jul 2022 16:39:51 +0000 (17:39 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 21 Jul 2022 16:39:51 +0000 (17:39 +0100)
cookbooks/prometheus/templates/default/alert_rules.yml.erb

index 96f7fdb0248045de20c050d159a8e5f18eef681a..94a2323d358a03ddc25213ad7c2e04c0945b0b17 100644 (file)
@@ -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