X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=system-status;h=dd327bb0836979310df0476389df5d4971a106dc;hb=89a1a98bb918fdf856d34900610413c79e32897e;hp=0e63964a78c519d1e5c1f0462fed7848ecc9d290;hpb=e168eaa6f27cc556b7edfb9148f80905d26e21f6;p=distro-setup diff --git a/system-status b/system-status index 0e63964..dd327bb 100755 --- a/system-status +++ b/system-status @@ -389,6 +389,20 @@ write-status() { # leave it up to epanic-clean to send email notification fi + mprom=/var/lib/prometheus/node-exporter/mailtest-check.prom + if grep -qE 'mailtest_check_(unexpected|missing).*[^ ][^0]$' $mprom; then + chars+=("MTEST_SPAM") + fi + mtest_found=false + for t in $(grep -E ^mailtest_check_last_usec $mprom | awk '{print $NF}'); do + if (( t + 60 * 20 < EPOCHSECONDS )); then + mtest_found=true + fi + done + if $mtest_found; then + chars+=("MTEST_AGE") + fi + if [[ ! -e $status_file || -w $status_file ]]; then if [[ -e /a/bin/bash_unpublished/source-state ]]; then cat /a/bin/bash_unpublished/source-state >$status_file