From ab63d5dbdb429eea4836bf7e149b12a61fafa63f Mon Sep 17 00:00:00 2001 From: Doug Burks Date: Thu, 15 Aug 2024 08:01:22 -0400 Subject: [PATCH] Update so-elasticsearch-cluster-space-used for changes in _cat/allocation API --- .../tools/sbin_jinja/so-elasticsearch-cluster-space-used | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/elasticsearch/tools/sbin_jinja/so-elasticsearch-cluster-space-used b/salt/elasticsearch/tools/sbin_jinja/so-elasticsearch-cluster-space-used index 49e634853..b18e84d71 100755 --- a/salt/elasticsearch/tools/sbin_jinja/so-elasticsearch-cluster-space-used +++ b/salt/elasticsearch/tools/sbin_jinja/so-elasticsearch-cluster-space-used @@ -13,10 +13,10 @@ TOTAL_USED_SPACE=0 # Iterate through the output of _cat/allocation for each node in the cluster to determine the total used space {% if GLOBALS.role == 'so-manager' %} # Get total disk space - disk.total -for i in $(/usr/sbin/so-elasticsearch-query _cat/allocation | grep -v "{{ GLOBALS.manager }}$" | awk '{print $3}'); do +for i in $(/usr/sbin/so-elasticsearch-query _cat/allocation | grep -v "{{ GLOBALS.manager }}$" | awk '{print $6}'); do {% else %} # Get disk space taken up by indices - disk.indices -for i in $(/usr/sbin/so-elasticsearch-query _cat/allocation | awk '{print $2}'); do +for i in $(/usr/sbin/so-elasticsearch-query _cat/allocation | awk '{print $5}'); do {% endif %} size=$(echo $i | grep -oE '[0-9].*' | awk '{print int($1+0.5)}') unit=$(echo $i | grep -oE '[A-Za-z]+')