diff --git a/install-dsmon.sh b/install-dsmon.sh index c060907..e7d7172 100755 --- a/install-dsmon.sh +++ b/install-dsmon.sh @@ -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]}"