aboutsummaryrefslogtreecommitdiff
path: root/testzed
diff options
context:
space:
mode:
authortdback <tyler@tdback.net>2024-12-04 18:50:37 -0500
committertdback <tyler@tdback.net>2024-12-04 18:50:37 -0500
commit58347fdfe21315ad3ccc0bd7c4703a8ec7aae797 (patch)
tree393fe8d69962e070c522e889b672ee9e97a88207 /testzed
initial commit to new repo
Diffstat (limited to 'testzed')
-rwxr-xr-xtestzed24
1 files changed, 24 insertions, 0 deletions
diff --git a/testzed b/testzed
new file mode 100755
index 0000000..b20110c
--- /dev/null
+++ b/testzed
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# testzed: A useful utility for testing ZFS ZED configurations.
+
+if [ "$(id -u)" -ne 0 ]; then
+ echo "script requires root privileges" >&2
+ exit 1
+fi
+
+FILE=/tmp/sparse_file
+POOL="test"
+
+# Create throwaway pool.
+dd if=/dev/zero of=$FILE bs=1 count=0 seek=512M
+zpool create $POOL $FILE
+
+# Scrub the pool (which will finish instantly) to send out a notification.
+# Ensure that ZED is configured with the option `ZED_NOTIFY_VERBOSE=1` to
+# receive an email even if no errors occurred.
+zpool scrub $POOL
+
+# Clean up after ourselves.
+zpool export $POOL
+rm $FILE