X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=check-remote-mailqs;h=047e8b7ccae997a5a77451a40b0f036387cfcf15;hb=e72acaee4cf7c394ca0e35b84d3afbd8ef5a4b32;hp=b47810162fa14f7d26aff69d294c0ae17576f953;hpb=12cab163424e3a7b0815646d1d4407f9b5839bcb;p=distro-setup diff --git a/check-remote-mailqs b/check-remote-mailqs index b478101..047e8b7 100755 --- a/check-remote-mailqs +++ b/check-remote-mailqs @@ -4,12 +4,14 @@ if [ -z "$BASH_VERSION" ]; then echo "error: shell is not bash" >&2; exit 1; fi -source /a/bin/errhandle/err +source /a/bin/bash-bear-trap/bash-bear shopt -s nullglob shopt -s dotglob -for h in bk je li frodo kwwg x3wg x2wg kdwg; do +# temp disabled: x2wg kwwg +# this list duplicated in brc2 ralerts +for h in bk je li x3wg kdwg sywg; do statedir=/b/bash_unpublished/mailq-state statefile=$statedir/$h [[ -d $statedir ]] || continue @@ -25,9 +27,16 @@ for h in bk je li frodo kwwg x3wg x2wg kdwg; do else if [[ -s $statefile ]]; then logsec=$(date +%s -d "$(head -n1 $statefile | awk '{print $1,$2}')") - nowsec=$(date +%s) - if (( logsec < nowsec - 60*60*48 )); then - echo $0: host $h ssh /usr/local/bin/check-mailq fail for over 48 hours + case h in + frodo) + hours=200 + ;; + *) + hours=20 + ;; + esac + if (( logsec < EPOCHSECONDS - 60*60*hours )); then + echo $0: host $h ssh /usr/local/bin/check-mailq fail for over $hours hours fi fi printf "%s\n" "$c" | ts "%F %T" >> $statefile