From 83faabb7577161457a1c15dd4066468e2889674a Mon Sep 17 00:00:00 2001
From: Florian Sesser <florian@privatestorage.io>
Date: Thu, 8 Sep 2022 13:02:54 +0200
Subject: [PATCH] Also alert when hosts that run ZFS run out of RAM

Forgot to add a second alert when I added the workaround to
not count the ZFS ARC into used memory :/
---
 .../resources-overview.json                   | 35 +++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/nixos/modules/monitoring/server/grafana-dashboards/resources-overview.json b/nixos/modules/monitoring/server/grafana-dashboards/resources-overview.json
index 28af6aef..8547575f 100644
--- a/nixos/modules/monitoring/server/grafana-dashboards/resources-overview.json
+++ b/nixos/modules/monitoring/server/grafana-dashboards/resources-overview.json
@@ -22,7 +22,7 @@
   "editable": true,
   "fiscalYearStartMonth": 0,
   "graphTooltip": 1,
-  "id": 41,
+  "id": 125,
   "links": [],
   "liveNow": false,
   "panels": [
@@ -275,7 +275,30 @@
             },
             "query": {
               "params": [
-                "A",
+                "Hosts without ZFS",
+                "15m",
+                "now"
+              ]
+            },
+            "reducer": {
+              "params": [],
+              "type": "avg"
+            },
+            "type": "query"
+          },
+          {
+            "evaluator": {
+              "params": [
+                0.8
+              ],
+              "type": "gt"
+            },
+            "operator": {
+              "type": "and"
+            },
+            "query": {
+              "params": [
+                "Hosts with ZFS",
                 "15m",
                 "now"
               ]
@@ -399,6 +422,14 @@
           "refId": "Hosts with ZFS"
         }
       ],
+      "thresholds": [
+        {
+          "colorMode": "critical",
+          "op": "gt",
+          "value": 0.8,
+          "visible": true
+        }
+      ],
       "title": "RAM used %",
       "type": "timeseries"
     },
-- 
GitLab