minor alerts improvements
[distro-setup] / brc2
diff --git a/brc2 b/brc2
index 9c941fec155146f664ce3a5b5f4d6cf7f556474d..9bc89d5158c499ff9892e08c26e1f193f5dcc690 100644 (file)
--- a/brc2
+++ b/brc2
@@ -282,6 +282,26 @@ aclear() {
   system-status _
 }
 
+alerts() {
+  find /var/local/cron-errors /home/iank/cron-errors /sysd-mail-once-state -type f
+}
+ralerts() { # remote alerts
+  local ret shell
+  # this list is duplicated in check-remote-mailqs
+  for h in bk je li frodo kwwg x3wg x2wg kdwg sywg; do
+    echo $h:
+    shell="ssh $h"
+    if [[ $HOSTNAME == "${h%wg}" ]]; then
+      shell=
+    fi
+    ret=0
+    $shell find /var/local/cron-errors /home/iank/cron-errors /sysd-mail-once-state -type f || ret=$?
+    if (( ret )); then
+      echo ret:$ret
+    fi
+  done
+}
+
 ap() {
   # pushd in case current directory has an ansible.cfg file
   pushd /a/xans >/dev/null