fix pillars we check

This commit is contained in:
m0duspwnens
2020-10-06 18:10:41 -04:00
parent 4a236b3f75
commit 48ca2cdff1

View File

@@ -1,5 +1,5 @@
#!/bin/bash
{% set WORKERS = salt['pillar.get']('sensor:zeekprocs', salt['pillar.get']('sensor:zeekpins') | length) %}
{% set WORKERS = salt['pillar.get']('sensor:zeek_lbprocs', salt['pillar.get']('sensor:zeek_pins') | length) %}
ZEEKLOG=/host/nsm/zeek/logs/current/capture_loss.log
if [ -f "$ZEEKLOG" ]; then
LOSS=$(tail -{{WORKERS}} $ZEEKLOG | awk -F, '{print $NF}' | sed 's/}//' | awk -F: '{LOSS += $2 / {{WORKERS}}} END { print "loss: " LOSS}')