update
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
VERS=2.3.44-03302025
|
VERS=2.3.45a-04032025
|
||||||
|
|
||||||
DS_FOLDER=/opt/idssys/dsmon
|
DS_FOLDER=/opt/idssys/dsmon
|
||||||
DS_CRONTAB_FOLDER=/opt/idssys/nodemgmt/crontabs
|
DS_CRONTAB_FOLDER=/opt/idssys/nodemgmt/crontabs
|
||||||
|
|||||||
12
dsmon.sh
12
dsmon.sh
@@ -185,7 +185,7 @@ RUN_CHECK(){
|
|||||||
host_limits_tmp[$hlname]=$hllim
|
host_limits_tmp[$hlname]=$hllim
|
||||||
done
|
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})
|
DRIVEINFO=(${DRIVEINFO})
|
||||||
|
|
||||||
# for x in "${!DRIVEINFO[@]}"; do printf "[%s]=%s\n" "$x" "${DRIVEINFO[$x]}" ; done
|
# for x in "${!DRIVEINFO[@]}"; do printf "[%s]=%s\n" "$x" "${DRIVEINFO[$x]}" ; done
|
||||||
@@ -297,6 +297,16 @@ RUN_CHECK(){
|
|||||||
|
|
||||||
unset DRIVEINFO_TOT DRIVEINFO_FREE DRIVEINFO_FREEPER DRIVEINFO_SHORTNAME DRIVES DRIVEINFO host_limits_tmp
|
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
|
else
|
||||||
# [ "${1}" != "report" ] &&
|
# [ "${1}" != "report" ] &&
|
||||||
echo -e "${idsCL[Yellow]} ${host_name[$hostid]} is down${idsCL[Default]}"; echo
|
echo -e "${idsCL[Yellow]} ${host_name[$hostid]} is down${idsCL[Default]}"; echo
|
||||||
|
|||||||
Reference in New Issue
Block a user