X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=check-remote-mailqs;h=2e98521d01e1359d2d6284953a9e2992029639fd;hb=9a1c9e1c16555a4158cfd4044a615d89ab877abc;hp=6e9cf7c2cebbd1cfde4df4fe0d971dd9b1802055;hpb=40dd151ec6ba75633c74568da59e35a45351f194;p=distro-setup diff --git a/check-remote-mailqs b/check-remote-mailqs index 6e9cf7c..2e98521 100755 --- a/check-remote-mailqs +++ b/check-remote-mailqs @@ -9,8 +9,9 @@ source /a/bin/errhandle/err shopt -s nullglob shopt -s dotglob +# temp disabled: x2wg kwwg # this list duplicated in brc2 ralerts -for h in bk je li frodo kwwg x3wg x2wg kdwg sywg; do +for h in bk je li frodo x3wg kdwg sywg; do statedir=/b/bash_unpublished/mailq-state statefile=$statedir/$h [[ -d $statedir ]] || continue @@ -26,9 +27,16 @@ for h in bk je li frodo kwwg x3wg x2wg kdwg sywg; 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*20 )); then - echo $0: host $h ssh /usr/local/bin/check-mailq fail for over 20 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