From e77e645a361f3f15cb9a9e2e504a565fbbd994fd Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Tue, 28 Mar 2023 11:45:57 -0400 Subject: [PATCH] Update so-elasticsearch-cluster-space-total --- salt/common/tools/sbin/so-elasticsearch-cluster-space-total | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/salt/common/tools/sbin/so-elasticsearch-cluster-space-total b/salt/common/tools/sbin/so-elasticsearch-cluster-space-total index f7bd151ad..0e10b026c 100755 --- a/salt/common/tools/sbin/so-elasticsearch-cluster-space-total +++ b/salt/common/tools/sbin/so-elasticsearch-cluster-space-total @@ -7,6 +7,8 @@ . /usr/sbin/so-common +{% from 'vars/globals.map.jinja' import GLOBALS %} + TOTAL_AVAILABLE_SPACE=0 # Wait for ElasticSearch to initialize @@ -37,7 +39,11 @@ else fi # Iterate through the output of _cat/allocation for each node in the cluster to determine the total available space +{% if GLOBALS.role == 'so-manager' %} +for i in $(/usr/sbin/so-elasticsearch-query _cat/allocation | grep -v {{ GLOBLAS.manager }} | awk '{print $5}'); do +{% else %} for i in $(/usr/sbin/so-elasticsearch-query _cat/allocation | awk '{print $5}'); do +{% endif %} size=$(echo $i | grep -oE '[0-9]+') unit=$(echo $i | grep -oE '[A-Za-z]+') if [ $unit = "tb" ]; then