diff --git a/salt/manager/tools/sbin/so-minion b/salt/manager/tools/sbin/so-minion index cc78e69e1..6de864e4b 100755 --- a/salt/manager/tools/sbin/so-minion +++ b/salt/manager/tools/sbin/so-minion @@ -95,10 +95,16 @@ for i in "$@"; do MAINIP="${i#*=}" shift ;; - -c=*|--cpu=*) + # Usable / Load Balance Cores for Zeek / Suricata + -C=*|--lbc=*) CORECOUNT="${i#*=}" shift ;; + # Total number of CPU Cores + -c=*|--cpu=*) + CPUCORES="${i#*=}" + shift + ;; -*|--*) echo "Unknown option $i" log "ERROR" "Unknown option $i" @@ -374,7 +380,7 @@ function add_logstash_to_minion() { "logstash:"\ " enabled: True"\ " config:"\ - " pipeline_x_workers: $CORECOUNT"\ + " pipeline_x_workers: $CPUCORES"\ " settings:"\ " lsheap: $LSHEAP"\ " " >> $PILLARFILE diff --git a/salt/reactor/sominion_setup.sls b/salt/reactor/sominion_setup.sls index 91889158b..547b1b686 100644 --- a/salt/reactor/sominion_setup.sls +++ b/salt/reactor/sominion_setup.sls @@ -16,13 +16,12 @@ def run(): hv_name = DATA['HYPERVISOR_HOST'] logging.debug('sominion_setup_reactor: DATA: %s' % DATA) - # Build the base command - cmd = "NODETYPE=" + DATA['NODETYPE'] + " /usr/sbin/so-minion -o=addVM -m=" + minionid + " -n=" + DATA['MNIC'] + " -i=" + DATA['MAINIP'] + " -d='" + DATA['NODE_DESCRIPTION'] + "'" + cmd = "NODETYPE=" + DATA['NODETYPE'] + " /usr/sbin/so-minion -o=addVM -m=" + minionid + " -n=" + DATA['MNIC'] + " -i=" + DATA['MAINIP'] + " -c=" + str(DATA['CPUCORES']) + " -d='" + DATA['NODE_DESCRIPTION'] + "'" # Add optional arguments only if they exist in DATA if 'CORECOUNT' in DATA: - cmd += " -c=" + str(DATA['CORECOUNT']) + cmd += " -C=" + str(DATA['CORECOUNT']) if 'INTERFACE' in DATA: cmd += " -a=" + DATA['INTERFACE'] diff --git a/salt/setup/virt/fleet.yaml b/salt/setup/virt/fleet.yaml deleted file mode 100644 index d6c90e11d..000000000 --- a/salt/setup/virt/fleet.yaml +++ /dev/null @@ -1,18 +0,0 @@ -MAINIP: -MNIC: enp1s0 -NODE_DESCRIPTION: 'vm' -ES_HEAP_SIZE: -PATCHSCHEDULENAME: -INTERFACE: -NODETYPE: FLEET -CORECOUNT: 8 -LSHOSTNAME: -LSHEAP: -CPUCORES: 8 -IDH_MGTRESTRICT: -IDH_SERVICES: -CPU: 8 -MEMORY: 8 -DISKS: 0 -COPPER: 0 -SFP: 0 diff --git a/salt/setup/virt/heavynode.yaml b/salt/setup/virt/heavynode.yaml deleted file mode 100644 index a3550021f..000000000 --- a/salt/setup/virt/heavynode.yaml +++ /dev/null @@ -1,18 +0,0 @@ -MAINIP: -MNIC: enp1s0 -NODE_DESCRIPTION: 'vm' -ES_HEAP_SIZE: -PATCHSCHEDULENAME: -INTERFACE: bond0 -NODETYPE: HEAVYNODE -CORECOUNT: 8 -LSHOSTNAME: -LSHEAP: -CPUCORES: 8 -IDH_MGTRESTRICT: -IDH_SERVICES: -CPU: 8 -MEMORY: 16 -DISKS: 0 -COPPER: 0 -SFP: 0 diff --git a/salt/setup/virt/idh.yaml b/salt/setup/virt/idh.yaml deleted file mode 100644 index 201262db8..000000000 --- a/salt/setup/virt/idh.yaml +++ /dev/null @@ -1,18 +0,0 @@ -MAINIP: -MNIC: enp1s0 -NODE_DESCRIPTION: 'vm' -ES_HEAP_SIZE: -PATCHSCHEDULENAME: -INTERFACE: -NODETYPE: IDH -CORECOUNT: 2 -LSHOSTNAME: -LSHEAP: -CPUCORES: 2 -IDH_MGTRESTRICT: -IDH_SERVICES: -CPU: 2 -MEMORY: 1 -DISKS: 0 -COPPER: 0 -SFP: 0 diff --git a/salt/setup/virt/receiver.yaml b/salt/setup/virt/receiver.yaml deleted file mode 100644 index e5dc0b0e7..000000000 --- a/salt/setup/virt/receiver.yaml +++ /dev/null @@ -1,18 +0,0 @@ -MAINIP: -MNIC: enp1s0 -NODE_DESCRIPTION: 'vm' -ES_HEAP_SIZE: -PATCHSCHEDULENAME: -INTERFACE: -NODETYPE: RECEIVER -CORECOUNT: 2 -LSHOSTNAME: -LSHEAP: -CPUCORES: 2 -IDH_MGTRESTRICT: -IDH_SERVICES: -CPU: 2 -MEMORY: 8 -DISKS: 0 -COPPER: 0 -SFP: 0 diff --git a/salt/setup/virt/searchnode.yaml b/salt/setup/virt/searchnode.yaml deleted file mode 100644 index 032e0e855..000000000 --- a/salt/setup/virt/searchnode.yaml +++ /dev/null @@ -1,18 +0,0 @@ -MAINIP: -MNIC: enp1s0 -NODE_DESCRIPTION: 'vm' -ES_HEAP_SIZE: -PATCHSCHEDULENAME: -INTERFACE: -NODETYPE: SEARCHNODE -CORECOUNT: 8 -LSHOSTNAME: -LSHEAP: -CPUCORES: 8 -IDH_MGTRESTRICT: -IDH_SERVICES: -CPU: 8 -MEMORY: 16 -DISKS: 1 -COPPER: 0 -SFP: 0 diff --git a/salt/setup/virt/sensor.yaml b/salt/setup/virt/sensor.yaml deleted file mode 100644 index 9136f0b78..000000000 --- a/salt/setup/virt/sensor.yaml +++ /dev/null @@ -1,18 +0,0 @@ -MAINIP: -MNIC: enp1s0 -NODE_DESCRIPTION: 'vm' -ES_HEAP_SIZE: -PATCHSCHEDULENAME: -INTERFACE: bond0 -NODETYPE: SENSOR -CORECOUNT: 4 -LSHOSTNAME: -LSHEAP: -CPUCORES: 4 -IDH_MGTRESTRICT: -IDH_SERVICES: -CPU: 8 -MEMORY: 12 -DISKS: 0 -COPPER: 0 -SFP: 0 diff --git a/salt/setup/virt/soinstall.map.jinja b/salt/setup/virt/soinstall.map.jinja index 1d70ac67e..d839235b0 100644 --- a/salt/setup/virt/soinstall.map.jinja +++ b/salt/setup/virt/soinstall.map.jinja @@ -40,12 +40,9 @@ {# Calculate reasonable core usage #} {% set cores_for_zeek = (DATA.CPUCORES / 2) - 1 %} -{% do salt.log.info('cores_for_zeek calculation using CPUCORES: ' ~ DATA.CPUCORES|string) %} -{% do salt.log.info('cores_for_zeek: ' ~ cores_for_zeek|string) %} {% set lb_procs_round = cores_for_zeek|round|int %} -{% do salt.log.info('lb_procs_round: ' ~ lb_procs_round|string) %} {% set lb_procs = 1 if lb_procs_round < 1 else lb_procs_round %} -{% do salt.log.info('lb_procs: ' ~ lb_procs|string) %} +{% do salt.log.info('Cores for load balancing: ' ~ lb_procs|string) %} {# Check memory conditions #} {% set low_mem = false %} {% do salt.log.info('Memory check using total_mem: ' ~ total_mem|string) %} diff --git a/salt/setup/virt/sominion.sls b/salt/setup/virt/sominion.sls index e0598a4d3..70acb52db 100644 --- a/salt/setup/virt/sominion.sls +++ b/salt/setup/virt/sominion.sls @@ -13,11 +13,14 @@ create_pillar: MAINIP: {{ DATA.MAINIP }} MNIC: {{ DATA.MNIC }} NODE_DESCRIPTION: '{{ DATA.NODE_DESCRIPTION }}' - INTERFACE: {{ DATA.INTERFACE }} NODETYPE: {{ DATA.NODETYPE }} + CPUCORES: {{ DATA.CPUCORES }} {% if 'CORECOUNT' in DATA %} CORECOUNT: {{ DATA.CORECOUNT }} {% endif %} + {% if 'INTERFACE' in DATA %} + INTERFACE: {{ DATA.INTERFACE }} + {% endif %} {% if 'ES_HEAP_SIZE' in DATA %} ES_HEAP_SIZE: {{ DATA.ES_HEAP_SIZE }} {% endif %}