From 1f617a484d854bbbb480b3b976ad4123f69808fe Mon Sep 17 00:00:00 2001 From: bjoerrrn <91031217+bjoerrrn@users.noreply.github.com> Date: Fri, 29 Jul 2022 14:38:32 +0200 Subject: [PATCH] Update storj-system-health.sh * minor tweak in the audit time lag jq statement --- storj-system-health.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/storj-system-health.sh b/storj-system-health.sh index 52e5656..63d5ec6 100644 --- a/storj-system-health.sh +++ b/storj-system-health.sh @@ -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 @@ -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 ), @@ -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