From ab44dad6ec19cf710b0910e25b5000b8a99f9b50 Mon Sep 17 00:00:00 2001 From: Ramil Valitov Date: Tue, 7 Jul 2020 05:37:40 +0300 Subject: [PATCH] [add] sort cache and results --- tests/all.sh | 3 ++- zabbix/zabbix_php_fpm_discovery.sh | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/all.sh b/tests/all.sh index a046f91..89ec737 100644 --- a/tests/all.sh +++ b/tests/all.sh @@ -224,7 +224,8 @@ function discoverAll() { else DATA_COUNT=$(echo "$DATA_COUNT + 1" | bc) if [[ $DATA_COUNT -gt 10 ]]; then - echo "Data old: $DATA_OLD, data new: $DATA" + echo "Data old: $DATA_OLD" + echo "Data new: $DATA" return 1 fi discoverAll "$DATA" "$DATA_COUNT" diff --git a/zabbix/zabbix_php_fpm_discovery.sh b/zabbix/zabbix_php_fpm_discovery.sh index 46c93e9..439c84e 100644 --- a/zabbix/zabbix_php_fpm_discovery.sh +++ b/zabbix/zabbix_php_fpm_discovery.sh @@ -300,6 +300,9 @@ function SavePrintResults() { PrintDebug "Saving pending pools list to file $PENDING_FILE..." ${S_PRINTF} "%s\n" "${PENDING_LIST[@]}" >"$PENDING_FILE" + #We must sort the cache list + readarray -t CACHE < <(for a in "${CACHE[@]}"; do echo "$a"; done | sort) + if [[ -n $DEBUG_MODE ]]; then PrintDebug "List of pools to be saved to cache pools file:" PrintCacheList