fix: change health_ok to status

This commit is contained in:
2026-05-08 16:57:45 -04:00
parent 967e05ed74
commit 217bba1b76
5 changed files with 29 additions and 22 deletions
+9 -1
View File
@@ -90,9 +90,17 @@ class ZFSMonitorPlugin(MonitorPlugin):
if self._pools_filter and name not in self._pools_filter:
continue
health = parts[1].strip()
if health == "ONLINE":
status = 0
elif health in ("DEGRADED", "ONLINE with errors"):
status = 1
elif health in ("FAULTED", "OFFLINE", "UNAVAIL"):
status = 2
else:
status = 3 # unknown status
pools[name] = {
"health": health,
"health_ok": 1 if health == "ONLINE" else 0,
"status": status,
"size": _int(parts[2]),
"alloc": _int(parts[3]),
"free": _int(parts[4]),