From 614a45fb481e2e3f728ba6d4cdb9b9861d114629 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Tue, 13 Oct 2020 15:19:34 +0200 Subject: [PATCH] usage of logical volumes --- gnt-lvs-usage.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 gnt-lvs-usage.sh diff --git a/gnt-lvs-usage.sh b/gnt-lvs-usage.sh new file mode 100755 index 0000000..f3f8d3a --- /dev/null +++ b/gnt-lvs-usage.sh @@ -0,0 +1,13 @@ +#!/bin/sh -e + +gnt-cluster command -M lvs -o vg_name,name,size,tags --unit g --noheadings | grep -v '^return' | grep -v '^--*$' | tee /dev/shm/gnt-lvs.clean + +echo "# total by inacnes (with replicas):" +cat /dev/shm/gnt-lvs.clean | awk -F ' ' '{a[$5] += $4} END{for (i in a) print i, a[i]}' | tee /dev/shm/lvs.instance.replicas + +echo "# total by inacnes (without replicas):" +cat /dev/shm/gnt-lvs.clean | awk -F ' ' '{a[$5] = $4} END{for (i in a) print i, a[i]}' | tee /dev/shm/lvs,instancs.data + +echo "# total by nodes:" +cat /dev/shm/gnt-lvs.clean | awk -F ' ' '{a[$1] += $4} END{for (i in a) print i, a[i]}' | tee /dev/shm/lvs.nodes + -- 2.20.1