check /proc/drbd and correlate with instances
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 17 Nov 2019 09:06:16 +0000 (10:06 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 17 Nov 2019 09:06:16 +0000 (10:06 +0100)
gnt-drbd-check.sh [new file with mode: 0644]

diff --git a/gnt-drbd-check.sh b/gnt-drbd-check.sh
new file mode 100644 (file)
index 0000000..55fa386
--- /dev/null
@@ -0,0 +1,10 @@
+
+gnt-cluster command -M ls -l /var/run/ganeti/instance-disks/ | awk '{ print $1 $12 " " $10 }' | tr ':' ' ' | tee /dev/shm/node.drbd.instance.disk
+
+gnt-cluster command -M cat /proc/drbd | grep cs: | grep -v Connected | tee /dev/shm/drbd.check | \
+       sed 's/: / /g' | \
+       while read node drbd status ; do
+               echo "$node $drbd [$status]"
+               grep "$node.*drbd$drbd " /dev/shm/node.drbd.instance.disk || echo "ERROR: can't find $node $drbd"
+       done
+