summaryrefslogtreecommitdiff
path: root/print-status
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2021-06-27 09:10:11 +0200
committerErich Eckner <git@eckner.net>2021-06-27 09:10:11 +0200
commit763e3c7bd3b70f7f59a9a23b259f714ff4d3d811 (patch)
treecfb59e6a59085a17360e0cdf3e74777504713894 /print-status
downloadprint-status-763e3c7bd3b70f7f59a9a23b259f714ff4d3d811.tar.xz
status quo
Diffstat (limited to 'print-status')
-rwxr-xr-xprint-status28
1 files changed, 28 insertions, 0 deletions
diff --git a/print-status b/print-status
new file mode 100755
index 0000000..f28821a
--- /dev/null
+++ b/print-status
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+{
+ find /dev/mapper -mindepth 1 -maxdepth 1 \( -name 'leg*' -o -name 'foot*' \) -printf '%f\n' \
+ | sort -u \
+ | xargs -rn1 cryptsetup status \
+ | grep -v '^\s\+device:'
+ sed -n '
+ /^Personalities/d
+ /^\S/ {
+ N
+ s/^\(\S\+\)\s*:.*\n\s*\([0-9]\)/\1: \2/
+ T
+ p
+ }
+ ' /proc/mdstat \
+ | sort -u
+ find /sys/block/ -mindepth 1 -maxdepth 1 -name 'md*' -printf '%f: ' -exec cat {}/md/mismatch_cnt \; \
+ | sort -u
+ ssacli ctrl slot=1 ld all show \
+ | grep -v '^\s*$'
+} | \
+ if mountpoint -q /srv/http/tmp; then
+ sponge /srv/http/tmp/status
+ date +%s > /srv/http/tmp/status.time
+ else
+ cat
+ fi