From e5caeeff1c6e4994e4def4d4b53c3db015f75389 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 3 Oct 2021 10:23:20 -0500 Subject: [PATCH] Update install-dsmon.sh --- install-dsmon.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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]}"