mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-20 16:03:06 +01:00
change log_size_limit logic - https://github.com/Security-Onion-Solutions/securityonion-saltstack/issues/551
This commit is contained in:
@@ -720,15 +720,25 @@ get_filesystem_nsm(){
|
||||
|
||||
get_log_size_limit() {
|
||||
|
||||
DISK_DIR="/"
|
||||
if [ -d /nsm ]; then
|
||||
DISK_DIR="/nsm"
|
||||
fi
|
||||
DISK_SIZE_K=`df $DISK_DIR |grep -v "^Filesystem" | awk '{print $2}'`
|
||||
PERCENTAGE=85
|
||||
DISK_SIZE=DISK_SIZE_K*1000
|
||||
PERCENTAGE_DISK_SPACE=`echo $(($DISK_SIZE*$PERCENTAGE/100))`
|
||||
LOG_SIZE_LIMIT=$(($PERCENTAGE_DISK_SPACE/1000000000))
|
||||
case $INSTALLTYPE in
|
||||
EVAL | HEAVYNODE)
|
||||
PERCENTAGE=50
|
||||
;;
|
||||
*)
|
||||
PERCENTAGE=80
|
||||
;;
|
||||
esac
|
||||
|
||||
DISK_DIR="/"
|
||||
|
||||
if [ -d /nsm ]; then
|
||||
DISK_DIR="/nsm"
|
||||
fi
|
||||
|
||||
DISK_SIZE_K=`df $DISK_DIR |grep -v "^Filesystem" | awk '{print $2}'`
|
||||
DISK_SIZE=DISK_SIZE_K*1000
|
||||
PERCENTAGE_DISK_SPACE=`echo $(($DISK_SIZE*$PERCENTAGE/100))`
|
||||
LOG_SIZE_LIMIT=$(($PERCENTAGE_DISK_SPACE/1000000000))
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -309,7 +309,7 @@ whiptail_log_size_limit() {
|
||||
|
||||
LOG_SIZE_LIMIT=$(whiptail --title "Security Onion Setup" --inputbox \
|
||||
"Please specify the amount of disk space (in GB) you would like to allocate for Elasticsearch data storage. \
|
||||
By default, this is set to 85% of the disk space allotted for /nsm." 10 75 $LOG_SIZE_LIMIT 3>&1 1>&2 2>&3)
|
||||
By default, this is set to 80% of the disk space allotted for /nsm." 10 75 $LOG_SIZE_LIMIT 3>&1 1>&2 2>&3)
|
||||
|
||||
local exitstatus=$?
|
||||
whiptail_check_exitstatus $exitstatus
|
||||
|
||||
Reference in New Issue
Block a user