Skip to content

Commit

Permalink
Update storj-system-health.sh
Browse files Browse the repository at this point in the history
* fixed some issues with the latest release
  • Loading branch information
bjoerrrn authored Aug 19, 2024
1 parent 81c6c63 commit d94de7b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions storj-system-health.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# v1.11
# v1.11.1
#
# storj-system-health.sh - storagenode health checks and notifications to discord / by email
# by dusselmann, https://github.com/dusselmann/storj-system-health.sh
Expand Down Expand Up @@ -533,12 +533,12 @@ audit_difference=0

# select error messages in detail (partially extracted text log)
[[ "$VERBOSE" == "true" ]] && INFO="$(echo "$LOG1H" 2>&1 | grep '[[:blank:]]*INFO')"
AUDS="$(echo "$LOG1H" 2>&1 | grep -E '[[:blank:]]*GET_AUDIT' | grep 'failed')"
AUDS=$(echo "$AUDS" 2>&1 | grep -v 'read: connection timed out')
AUDS="$(echo "$LOG1H" 2>&1 | grep -E 'GET_AUDIT' | grep 'failed')"
AUDS=$(echo "$AUDS" 2>&1 | grep -v -e 'connection timed out' -e 'connection reset by peer')
FATS="$(echo "$LOG1H" 2>&1 | grep '[[:blank:]]*FATAL' | grep -v '[[:blank:]]*INFO')"
ERRS="$(echo "$LOG1H" 2>&1 | grep '[[:blank:]]*ERROR' | grep -v -e '[[:blank:]]*INFO' -e '[[:blank:]]*FATAL' -e 'collector' -e 'piecestore' -e 'pieces error: filestore error: context canceled' -e 'piecedeleter' -e 'emptying trash failed' -e 'service ping satellite failed' -e 'timeout: no recent network activity' -e 'connection reset by peer' -e 'context canceled' -e 'tcp connector failed' -e 'node rate limited by id' -e 'manager closed: read tcp' -e 'connection timed out')"
DREPS="$(echo "$LOG1H" 2>&1 | grep -E '[[:blank:]]*GET_REPAIR' | grep 'failed')"
DREPS=$(echo "$DREPS" 2>&1 | grep -v 'connection timed out')
DREPS="$(echo "$LOG1H" 2>&1 | grep -E 'GET_REPAIR' | grep 'failed')"
DREPS=$(echo "$DREPS" 2>&1 | grep -v -e 'connection timed out' -e 'connection reset by peer')

# added "severe" errors in order to recognize e.g. docker issues, connectivity issues etc.
SEVERE="$(echo "$LOG1H" 2>&1 | grep -i -e 'error:' -e 'fatal:' -e 'unexpected shutdown' -e 'fatal error' -e 'transport endpoint is not connected' -e 'Unable to read the disk' -e 'software caused connection abort' | grep -v -e 'emptying trash failed' -e '[[:blank:]]*INFO' -e '[[:blank:]]*FATAL' -e 'collector' -e 'piecestore' -e 'pieces error: filestore error: context canceled' -e 'piecedeleter' -e 'emptying trash failed' -e 'service ping satellite failed' -e 'timeout: no recent network activity' -e 'failed to settle orders for satellite' -e 'rpc client' -e 'manager closed: read tcp' -e 'connection timed out')"
Expand All @@ -549,7 +549,7 @@ SEVERE="$(echo "$LOG1H" 2>&1 | grep -i -e 'error:' -e 'fatal:' -e 'unexpected sh
# count errors
[[ "$VERBOSE" == "true" ]] && tmp_info="$(echo "$INFO" 2>&1 | grep '[[:blank:]]*INFO' -c)"
tmp_fatal_errors="$(echo "$FATS" 2>&1 | grep '[[:blank:]]*FATAL' -c)"
tmp_audits_failed="$(echo "$AUDS" 2>&1 | grep -E '[[:blank:]]*GET_AUDIT' | grep 'failed' -c)"
tmp_audits_failed="$(echo "$AUDS" 2>&1 | grep -E 'GET_AUDIT' | grep 'failed' -c)"
tmp_reps_failed="$(echo "$DREPS" 2>&1 | grep 'failed' -c)"
tmp_rest_of_errors="$(echo "$ERRS" 2>&1 | grep '[[:blank:]]*ERROR' -c)"
tmp_io_errors="$(echo "$ERRS" 2>&1 | grep '[[:blank:]]*ERROR' | grep -e 'timeout' -e 'connection reset' -e 'tcp connector failed' -e 'node rate limited by id' -c)"
Expand Down

0 comments on commit d94de7b

Please sign in to comment.