Skip to content

Commit

Permalink
Update storj-system-health.sh
Browse files Browse the repository at this point in the history
* minor tweak in the audit time lag jq statement
  • Loading branch information
bjoerrrn authored Jul 29, 2022
1 parent 347c745 commit 1f617a4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions storj-system-health.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# v1.9.1
# v1.9.2
#
# 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 @@ -852,8 +852,7 @@ tmp_auditTimeLags=$(echo -E $(echo "$LOG1H" |
jq -Rn '
reduce (
inputs / "\t" |
select( length == 5 ) |
.[4] |= fromjson |
try ( .[4] |= fromjson ) catch empty |
select(.[4].Action == "GET_AUDIT") |
[
( .[0] | sub("\\.\\d+Z$"; "Z") | strptime("%Y-%m-%dT%H:%M:%SZ") | mktime ),
Expand All @@ -878,6 +877,9 @@ jq -Rn '
if .[0] != {} then .[0] else empty end
'))

# tmp_auditTimeLags=$(echo -E $(echo "$LOG1H" |
# '))

# help variable to test, if content is null or not
[ -n "$tmp_auditTimeLags" ] && tmp_auditTimeLagsFilled=true || tmp_auditTimeLagsFilled=false

Expand Down

0 comments on commit 1f617a4

Please sign in to comment.