Update install-dsmon.sh

This commit is contained in:
2021-10-03 10:23:20 -05:00
parent 2e694ebbea
commit e5caeeff1c

View File

@@ -23,15 +23,23 @@ if [ ! -d "/opt/idssys/settings" ]; then
do_with_root mkdir /opt/idssys/settings
fi
echo -e -n "${idsCL[LightCyan]}What threshold should we set? (Default=90(%)): ${idsCL[Default]}"
TOTALSPACE=$(df / | grep / | awk '{ print $2}')
TOTALSPACE=$(bc <<< "scale=2; $TOTALSPACE/1024/1024")
THRESHOLDSPACE=$(bc <<< "scale=2; $TOTALSPACE*.8")
echo -e "${idsCL[LightCyan]}Root drive size: ${idsCL[LightGreen]}"$TOTALSPACE"GB${idsCL[Default]}"
echo -e "${idsCL[LightCyan]}Default thresholf of 80%: ${idsCL[LightGreen]}"$THRESHOLDSPACE"GB${idsCL[Default]}"
echo -e -n "${idsCL[LightCyan]}What threshold should we set? Default=80: ${idsCL[Default]}"
read SET_THRESHOLD
echo ""
echo -e -n "${idsCL[LightCyan]}Email address to receive alerts: ${idsCL[Default]}"
read SET_ALERTEMAIL
echo ""
if [ "${SET_THRESHOLD}" = "" ]; then
SET_THRESHOLD=90
SET_THRESHOLD=80
fi
echo -e "${idsCL[Yellow]}Sending test Alert... ${idsCL[Default]}"