Update so-elasticsearch-cluster-space-total

This commit is contained in:
Mike Reeves
2023-03-28 11:45:57 -04:00
committed by GitHub
parent 942182e826
commit e77e645a36

View File

@@ -7,6 +7,8 @@
. /usr/sbin/so-common . /usr/sbin/so-common
{% from 'vars/globals.map.jinja' import GLOBALS %}
TOTAL_AVAILABLE_SPACE=0 TOTAL_AVAILABLE_SPACE=0
# Wait for ElasticSearch to initialize # Wait for ElasticSearch to initialize
@@ -37,7 +39,11 @@ else
fi fi
# Iterate through the output of _cat/allocation for each node in the cluster to determine the total available space # 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 for i in $(/usr/sbin/so-elasticsearch-query _cat/allocation | awk '{print $5}'); do
{% endif %}
size=$(echo $i | grep -oE '[0-9]+') size=$(echo $i | grep -oE '[0-9]+')
unit=$(echo $i | grep -oE '[A-Za-z]+') unit=$(echo $i | grep -oE '[A-Za-z]+')
if [ $unit = "tb" ]; then if [ $unit = "tb" ]; then