From a0ee25900d12f8a473a1bc6f403482407dfa6bcd Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 3 Apr 2025 17:57:57 -0500 Subject: [PATCH] update --- defaults.inc | 2 +- dsmon.sh | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/defaults.inc b/defaults.inc index 434fc98..dd08c59 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERS=2.3.44-03302025 +VERS=2.3.45a-04032025 DS_FOLDER=/opt/idssys/dsmon DS_CRONTAB_FOLDER=/opt/idssys/nodemgmt/crontabs diff --git a/dsmon.sh b/dsmon.sh index b3b3213..a0ede47 100755 --- a/dsmon.sh +++ b/dsmon.sh @@ -185,7 +185,7 @@ RUN_CHECK(){ host_limits_tmp[$hlname]=$hllim done - DRIVEINFO=$(ssh root@${host_ip[$hostid]} df -BM | grep -vE '^Filesystem|tmpfs|cdrom|@|ram|loop|udev|veeamimage|localhost|shm|overlay|-volume|Music|Software|//|AFS' | awk '{ print $1 " " $2 " " $4 }') + DRIVEINFO=$(ssh -o BatchMode=yes -o ConnectTimeout=3 root@${host_ip[$hostid]} df -BM | grep -vE '^Filesystem|tmpfs|cdrom|@|ram|loop|udev|veeamimage|localhost|shm|overlay|-volume|Music|Software|//|AFS' | awk '{ print $1 " " $2 " " $4 }') DRIVEINFO=(${DRIVEINFO}) # for x in "${!DRIVEINFO[@]}"; do printf "[%s]=%s\n" "$x" "${DRIVEINFO[$x]}" ; done @@ -296,6 +296,16 @@ RUN_CHECK(){ done unset DRIVEINFO_TOT DRIVEINFO_FREE DRIVEINFO_FREEPER DRIVEINFO_SHORTNAME DRIVES DRIVEINFO host_limits_tmp + + if [[ "$(ssh -o BatchMode=yes -o ConnectTimeout=3 root@${host_ip[$hostid]} du -hs /var/log/mail.log | cut -d'/' -f 1)" = *'M'* ]]; then + if [ ! -f /tmp/dsmon.mail-log.${host_ip[$hostid]}.errorsent ] || ([ -f /tmp/dsmon.mail-log.${host_ip[$hostid]}.errorsent ] && [ $(expr $(date +%s) - $(stat -c %Y /tmp/dsmon.mail-log.${host_ip[$hostid]}.errorsent)) -gt 3600 ]); then + SENDNOTICE "Mail Log Getting Big" "Mail log getting big on hostname [${host_ip[$hostid]}]" 1 + touch /tmp/dsmon.mail-log.${host_ip[$hostid]}.errorsent + fi + elif [ -f /tmp/dsmon.mail-log.${host_ip[$hostid]}.errorsent ]; then + rm -f /tmp/dsmon.mail-log.${host_ip[$hostid]}.errorsent + fi + else # [ "${1}" != "report" ] &&