Update dsmon.sh

This commit is contained in:
2025-04-03 18:09:46 -05:00
parent a6446f959e
commit bc06856940

View File

@@ -298,7 +298,7 @@ RUN_CHECK(){
unset DRIVEINFO_TOT DRIVEINFO_FREE DRIVEINFO_FREEPER DRIVEINFO_SHORTNAME DRIVES DRIVEINFO host_limits_tmp
maillogsize=$(ssh -o BatchMode=yes -o ConnectTimeout=3 root@${host_ip[$hostid]} du -hs /var/log/mail.log | cut -d'/' -f 1)
if [[ "${maillogsize//[[:blank:]]/}" = *'K'* ]]; then
if [[ "${maillogsize//[[:blank:]]/}" = *'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 (${maillogsize//[[:blank:]]/}) on ${hostname} [${host_ip[$hostid]}]" 1
touch /tmp/dsmon.mail-log.${host_ip[$hostid]}.errorsent