Update dsmon.sh
This commit is contained in:
4
dsmon.sh
4
dsmon.sh
@@ -300,13 +300,13 @@ RUN_CHECK(){
|
|||||||
maillogsize=$(ssh -o BatchMode=yes -o ConnectTimeout=3 root@${host_ip[$hostid]} du -hs /var/log/mail.log | cut -d'/' -f 1)
|
maillogsize=$(ssh -o BatchMode=yes -o ConnectTimeout=3 root@${host_ip[$hostid]} du -hs /var/log/mail.log | cut -d'/' -f 1)
|
||||||
if [[ "${maillogsize}" = *'M'* ]]; then
|
if [[ "${maillogsize}" = *'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
|
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// /}) on hostname [${host_ip[$hostid]}]" 1
|
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
|
touch /tmp/dsmon.mail-log.${host_ip[$hostid]}.errorsent
|
||||||
fi
|
fi
|
||||||
elif [ -f /tmp/dsmon.mail-log.${host_ip[$hostid]}.errorsent ]; then
|
elif [ -f /tmp/dsmon.mail-log.${host_ip[$hostid]}.errorsent ]; then
|
||||||
rm -f /tmp/dsmon.mail-log.${host_ip[$hostid]}.errorsent
|
rm -f /tmp/dsmon.mail-log.${host_ip[$hostid]}.errorsent
|
||||||
fi
|
fi
|
||||||
|
echo "mailLog: ${hostname} = '${maillogsize//[[:blank:]]/}'"
|
||||||
|
|
||||||
else
|
else
|
||||||
# [ "${1}" != "report" ] &&
|
# [ "${1}" != "report" ] &&
|
||||||
|
|||||||
Reference in New Issue
Block a user