Skip to content

Commit

Permalink
Fix percent calc
Browse files Browse the repository at this point in the history
  • Loading branch information
TOoSmOotH committed Mar 6, 2024
1 parent 4dfa1a5 commit ad12093
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions salt/manager/tools/sbin/so-minion
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function pcapspace() {
if [[ "$OPERATION" == "setup" ]]; then
# Use 25% for PCAP
PCAP_PERCENTAGE=1
DFREEPERCENT=75
local SPACESIZE=$(df -k /nsm | tail -1 | awk '{print $2}' | tr -d \n)
else

Expand Down Expand Up @@ -269,15 +270,18 @@ function add_sensor_to_minion() {
echo " lb_procs: '$CORECOUNT'" >> $PILLARFILE
echo "suricata:" >> $PILLARFILE
echo " enabled: True " >> $PILLARFILE
if [[ $is_pcaplimit ]]; then
echo " pcap:" >> $PILLARFILE
echo " maxsize: $MAX_PCAP_SPACE" >> $PILLARFILE
fi
echo " config:" >> $PILLARFILE
echo " af-packet:" >> $PILLARFILE
echo " threads: '$CORECOUNT'" >> $PILLARFILE
echo "pcap:" >> $PILLARFILE
echo " enabled: True" >> $PILLARFILE
if [[ $is_pcaplimit ]]; then
echo " config:" >> $PILLARFILE
echo " diskfreepercentage: 75" >> $PILLARFILE
echo " suripcapmaxsize: $MAX_PCAP_SPACE" >> $PILLARFILE
echo " diskfreepercentage: $DFREEPERCENT" >> $PILLARFILE
fi
echo " " >> $PILLARFILE
}
Expand Down Expand Up @@ -560,6 +564,7 @@ function createIDH() {
function createHEAVYNODE() {
is_pcaplimit=true
PCAP_PERCENTAGE=1
DFREEPERCENT=75
pcapspace
add_elasticsearch_to_minion
add_elastic_agent_to_minion
Expand All @@ -572,6 +577,7 @@ function createHEAVYNODE() {

function createSENSOR() {
is_pcaplimit=true
DFREEPERCENT=10
PCAP_PERCENTAGE=3
pcapspace
add_sensor_to_minion
Expand Down

0 comments on commit ad12093

Please sign in to comment.