From d97bd58e8a6ac9718645bdd2faf4ad8ba42689ca Mon Sep 17 00:00:00 2001 From: "dlt.green" Date: Wed, 4 Sep 2024 13:18:04 +0200 Subject: [PATCH] Reapply "installer: add automatic evm db reset when diskspace > 98%" This reverts commit 3a35d51e6620d3d9579872c2f5416528e13ecb63. --- node-installer.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/node-installer.sh b/node-installer.sh index 41c96bac..873fde07 100644 --- a/node-installer.sh +++ b/node-installer.sh @@ -1113,6 +1113,19 @@ Dashboard() { sleep 60 VAR_STATUS="$(docker inspect "$(echo "$NODE" | sed 's/\//./g')" | jq -r '.[] .State .Health .Status')" + if [ "$(df -h ./ | tail -1 | tr -s ' ' | cut -d ' ' -f 5 | sed 's/%//g')" -gt 98 ]; then + if [ "$NODE" = 'iota-wasp' ]; then if [ -d /var/lib/"$NODE"/data/waspdb/wal/$VAR_IOTA_EVM_ADDR ]; then + echo "$rd""diskspace error: ""reset iota-evm database activated""$xx" + if [ "$opt_mode" ]; then NotifyMessage "!err" "$VAR_DOMAIN" 'installer: reset iota-evm database activated'; fi + VAR_STATUS = 'unhealthy' + fi; fi + if [ "$NODE" = 'shimmer-wasp' ]; then if [ -d /var/lib/"$NODE"/data/waspdb/wal/$VAR_SHIMMER_EVM_ADDR ]; then + echo "$rd""diskspace error: ""reset shimmer-evm database activated""$xx" + if [ "$opt_mode" ]; then NotifyMessage "!err" "$VAR_DOMAIN" 'installer: reset shimmer-evm database activated'; fi + VAR_STATUS = 'unhealthy' + fi; fi + fi + if [ "$VAR_STATUS" = 'unhealthy' ]; then VAR_STATUS="$NODE$NETWORK: $VAR_STATUS" if [ "$opt_mode" = 's' ]; then NotifyMessage "err!" "$VAR_DOMAIN" "$VAR_STATUS"; fi @@ -2876,7 +2889,7 @@ SystemMaintenance() { if [ "$opt_mode" ]; then NotifyMessage "warn" "$VAR_DOMAIN" "$VAR_STATUS"; fi fi if [ "$(df -h ./ | tail -1 | tr -s ' ' | cut -d ' ' -f 5 | sed 's/%//g')" -gt 97 ]; then - echo "$ge""diskspace critical: ""$(df -h ./ | tail -1 | tr -s ' ' | cut -d ' ' -f 5)"' full'"$xx" + echo "$rd""diskspace critical: ""$(df -h ./ | tail -1 | tr -s ' ' | cut -d ' ' -f 5)"' full'"$xx" if [ "$opt_mode" ]; then NotifyMessage "!err" "$VAR_DOMAIN" "$VAR_STATUS"; fi fi