Update install-dsmon.sh
This commit is contained in:
@@ -43,14 +43,26 @@ if [ "${SET_THRESHOLD}" = "" ]; then
|
||||
fi
|
||||
|
||||
echo -e "${idsCL[Yellow]}Sending test Alert... ${idsCL[Default]}"
|
||||
echo "Test Alert" | mail -r DSMon-$(hostname -s)@scity.us -s "Test" $SET_ALERTEMAIL
|
||||
echo "Test Alert" | mail -r DSMon_$(hostname -s)@scity.us -s "Test" $SET_ALERTEMAIL
|
||||
|
||||
echo -e "${idsCL[Yellow]}Adding task to crontab... ${idsCL[Default]}"
|
||||
(crontab -l ; echo "0 */3 * * * /usr/local/bin/dsmon")| crontab -
|
||||
|
||||
echo -e "THRESHOLD=$SET_THRESHOLD
|
||||
ALERT_EMAIL=$SET_ALERTEMAIL
|
||||
" > /opt/idssys/settings/dsmon.conf
|
||||
" > /opt/idssys/dsmon/settings.conf
|
||||
|
||||
echo -e "echo \"*Restarting Zimbra*\" >> /opt/idssys/dsmon/diskspace.log
|
||||
mail -r DSMon-\$(hostname -s)@scity.us -s 'Disk Space Alert' \$ALERT_EMAIL << EOF
|
||||
Your root partition remaining free space is running low. Used: $CURRENT%
|
||||
Restarting Zimbra
|
||||
EOF
|
||||
date=\$(date '+%Y-%m-%d')
|
||||
/usr/bin/sudo -iu zimbra zmcontrol stop
|
||||
/bin/gzip /opt/zimbra/log/mailbox.log => /opt/zimbra/log/mailbox.log.\$date.gz
|
||||
/bin/rm -f /opt/zimbra/log/mailbox.log
|
||||
/usr/bin/sudo -iu zimbra zmcontrol start
|
||||
" > /opt/idssys/dsmon/actions.conf
|
||||
|
||||
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user