]> code.delx.au - monosys/commitdiff
healthcheck: zpool-health
authorJames Bunton <jamesbunton@delx.net.au>
Wed, 17 Jun 2020 13:00:51 +0000 (23:00 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Wed, 17 Jun 2020 13:00:51 +0000 (23:00 +1000)
healthcheck/zpool-health [new file with mode: 0755]

diff --git a/healthcheck/zpool-health b/healthcheck/zpool-health
new file mode 100755 (executable)
index 0000000..0864b80
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+if ! command -v zpool > /dev/null; then
+   exit 0
+fi
+
+if zpool list -H -o health,name | grep -qv ONLINE; then
+   zpool status -v
+fi