Skip to content

Commit

Permalink
Reapply "installer: add automatic evm db reset when diskspace > 98%"
Browse files Browse the repository at this point in the history
This reverts commit 3a35d51.
  • Loading branch information
dlt-green committed Sep 4, 2024
1 parent 2da8949 commit d97bd58
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion node-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit d97bd58

Please sign in to comment.