mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
remove debug echo, mkdir verbose
This commit is contained in:
@@ -245,7 +245,6 @@ check_sudoers() {
|
||||
}
|
||||
|
||||
check_log_size_limit() {
|
||||
echo "called check_log_size_limit"
|
||||
local num_minion_pillars
|
||||
num_minion_pillars=$(find /opt/so/saltstack/local/pillar/minions/ -type f | wc -l)
|
||||
|
||||
@@ -255,9 +254,7 @@ check_log_size_limit() {
|
||||
fi
|
||||
else
|
||||
local minion_id
|
||||
echo "getting id grain in check_log_size_limit"
|
||||
minion_id=$(lookup_salt_value "id" "" "grains" "" "local")
|
||||
echo "found minion_id to be $minion_id"
|
||||
|
||||
local minion_arr
|
||||
IFS='_' read -ra minion_arr <<< "$minion_id"
|
||||
@@ -265,17 +262,14 @@ check_log_size_limit() {
|
||||
local node_type="${minion_arr[0]}"
|
||||
|
||||
local current_limit
|
||||
echo "getting log_size_limit pillar in check_log_size_limit"
|
||||
|
||||
# since it is possible for the salt-master service to be stopped when this is run, we need to check the pillar values locally
|
||||
# we need to combine default local and default pillars before doing this so we can define --pillar-root in salt-call
|
||||
local epoch_date=$(date +%s%N)
|
||||
mkdir -p /opt/so/saltstack/soup_tmp_${epoch_date}/
|
||||
mkdir -vp /opt/so/saltstack/soup_tmp_${epoch_date}/
|
||||
cp -r /opt/so/saltstack/default/pillar/ /opt/so/saltstack/soup_tmp_${epoch_date}/
|
||||
# use \cp here to overwrite any pillar files from default with those in local for the tmp directory
|
||||
\cp -r /opt/so/saltstack/local/pillar/ /opt/so/saltstack/soup_tmp_${epoch_date}/
|
||||
current_limit=$(salt-call pillar.get elasticsearch:log_size_limit --local --pillar-root=/opt/so/saltstack/soup_tmp_${epoch_date}/pillar)
|
||||
echo "found log_size_limit to be $current_limit"
|
||||
rm -rf /opt/so/saltstack/soup_tmp_${epoch_date}/
|
||||
|
||||
local percent
|
||||
|
||||
Reference in New Issue
Block a user