mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
add zeekcaptureloss to data to influxdb. rename broloss to zeekloss - https://github.com/Security-Onion-Solutions/securityonion/issues/1403
This commit is contained in:
@@ -414,7 +414,7 @@
|
|||||||
"type": "fill"
|
"type": "fill"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"measurement": "brodrop",
|
"measurement": "zeekdrop",
|
||||||
"orderByTime": "ASC",
|
"orderByTime": "ASC",
|
||||||
"policy": "default",
|
"policy": "default",
|
||||||
"refId": "A",
|
"refId": "A",
|
||||||
|
|||||||
@@ -413,7 +413,7 @@
|
|||||||
"type": "fill"
|
"type": "fill"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"measurement": "brodrop",
|
"measurement": "zeekdrop",
|
||||||
"orderByTime": "ASC",
|
"orderByTime": "ASC",
|
||||||
"policy": "default",
|
"policy": "default",
|
||||||
"refId": "A",
|
"refId": "A",
|
||||||
|
|||||||
@@ -4428,7 +4428,7 @@
|
|||||||
"type": "fill"
|
"type": "fill"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"measurement": "brodrop",
|
"measurement": "zeekdrop",
|
||||||
"orderByTime": "ASC",
|
"orderByTime": "ASC",
|
||||||
"policy": "default",
|
"policy": "default",
|
||||||
"refId": "A",
|
"refId": "A",
|
||||||
|
|||||||
@@ -679,7 +679,8 @@
|
|||||||
"/scripts/stenoloss.sh",
|
"/scripts/stenoloss.sh",
|
||||||
"/scripts/suriloss.sh",
|
"/scripts/suriloss.sh",
|
||||||
"/scripts/checkfiles.sh",
|
"/scripts/checkfiles.sh",
|
||||||
"/scripts/broloss.sh",
|
"/scripts/zeekloss.sh",
|
||||||
|
"/scripts/zeekcaptureloss.sh",
|
||||||
"/scripts/oldpcap.sh"
|
"/scripts/oldpcap.sh"
|
||||||
]
|
]
|
||||||
data_format = "influx"
|
data_format = "influx"
|
||||||
@@ -691,7 +692,8 @@
|
|||||||
"/scripts/stenoloss.sh",
|
"/scripts/stenoloss.sh",
|
||||||
"/scripts/suriloss.sh",
|
"/scripts/suriloss.sh",
|
||||||
"/scripts/checkfiles.sh",
|
"/scripts/checkfiles.sh",
|
||||||
"/scripts/broloss.sh",
|
"/scripts/zeekloss.sh",
|
||||||
|
"/scripts/zeekcaptureloss.sh",
|
||||||
"/scripts/oldpcap.sh"
|
"/scripts/oldpcap.sh"
|
||||||
]
|
]
|
||||||
data_format = "influx"
|
data_format = "influx"
|
||||||
@@ -702,7 +704,8 @@
|
|||||||
"/scripts/stenoloss.sh",
|
"/scripts/stenoloss.sh",
|
||||||
"/scripts/suriloss.sh",
|
"/scripts/suriloss.sh",
|
||||||
"/scripts/checkfiles.sh",
|
"/scripts/checkfiles.sh",
|
||||||
"/scripts/broloss.sh",
|
"/scripts/zeekloss.sh",
|
||||||
|
"/scripts/zeekcaptureloss.sh",
|
||||||
"/scripts/oldpcap.sh",
|
"/scripts/oldpcap.sh",
|
||||||
"/scripts/influxdbsize.sh"
|
"/scripts/influxdbsize.sh"
|
||||||
]
|
]
|
||||||
@@ -713,7 +716,8 @@
|
|||||||
"/scripts/stenoloss.sh",
|
"/scripts/stenoloss.sh",
|
||||||
"/scripts/suriloss.sh",
|
"/scripts/suriloss.sh",
|
||||||
"/scripts/checkfiles.sh",
|
"/scripts/checkfiles.sh",
|
||||||
"/scripts/broloss.sh",
|
"/scripts/zeekloss.sh",
|
||||||
|
"/scripts/zeekcaptureloss.sh",
|
||||||
"/scripts/oldpcap.sh",
|
"/scripts/oldpcap.sh",
|
||||||
"/scripts/helixeps.sh"
|
"/scripts/helixeps.sh"
|
||||||
]
|
]
|
||||||
|
|||||||
7
salt/telegraf/scripts/zeekcaptureloss.sh
Normal file
7
salt/telegraf/scripts/zeekcaptureloss.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
{% set WORKERS = salt['pillar.get']('sensor:zeekprocs', salt['pillar.get']('sensor:zeekpins') | 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}')
|
||||||
|
echo "zeekcaptureloss loss=$LOSS"
|
||||||
|
fi
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
ZEEKLOG=$(tac /host/nsm/zeek/logs/packetloss.log | head -2)
|
ZEEKLOG=$(tac /host/nsm/zeek/logs/packetloss.log | head -2)
|
||||||
declare RESULT=($ZEEKLOG)
|
declare RESULT=($ZEEKLOG)
|
||||||
CURRENTDROP=${RESULT[3]}
|
CURRENTDROP=${RESULT[3]}
|
||||||
@@ -7,11 +6,11 @@ PASTDROP=${RESULT[9]}
|
|||||||
DROPPED=$((CURRENTDROP - PASTDROP))
|
DROPPED=$((CURRENTDROP - PASTDROP))
|
||||||
if [ $DROPPED == 0 ]; then
|
if [ $DROPPED == 0 ]; then
|
||||||
LOSS=0
|
LOSS=0
|
||||||
echo "brodrop drop=0"
|
echo "zeekdrop drop=0"
|
||||||
else
|
else
|
||||||
CURRENTPACKETS=${RESULT[5]}
|
CURRENTPACKETS=${RESULT[5]}
|
||||||
PASTPACKETS=${RESULT[11]}
|
PASTPACKETS=${RESULT[11]}
|
||||||
TOTAL=$((CURRENTPACKETS - PASTPACKETS))
|
TOTAL=$((CURRENTPACKETS - PASTPACKETS))
|
||||||
LOSS=$(echo $DROPPED $TOTAL / p | dc)
|
LOSS=$(echo $DROPPED $TOTAL / p | dc)
|
||||||
echo "brodrop drop=$LOSS"
|
echo "zeekdrop drop=$LOSS"
|
||||||
fi
|
fi
|
||||||
Reference in New Issue
Block a user