mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Common Module - Add Suricata PL tracker
This commit is contained in:
@@ -178,6 +178,7 @@ so-telegraf:
|
||||
- /etc/pki/influxdb.key:/etc/telegraf/telegraf.key:ro
|
||||
- /opt/so/conf/telegraf/scripts:/scripts:ro
|
||||
- /opt/so/log/stenographer:/var/log/stenographer:ro
|
||||
- /opt/so/log/suricata:/var/log/suricata:ro
|
||||
- watch:
|
||||
- /opt/so/conf/telegraf/etc/telegraf.conf
|
||||
- /opt/so/conf/telegraf/scripts
|
||||
|
||||
15
salt/common/telegraf/scripts/suriloss.sh
Normal file
15
salt/common/telegraf/scripts/suriloss.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
SURILOG=$(tac /var/log/suricata/stats.log | grep kernel | head -4)
|
||||
declare RESULT=($SURILOG)
|
||||
|
||||
CURRENTDROP=${RESULT[4]}
|
||||
PASTDROP=${RESULT[14]}
|
||||
DROPPED=$(($CURRENTDROP - $PASTDROP))
|
||||
|
||||
CURRENTPACKETS=${RESULT[9]}
|
||||
PASTPACKETS=${RESULT[19]}
|
||||
TOTAL=$(($CURRENTPACKETS - $PASTPACKETS))
|
||||
|
||||
LOSS=$(echo $DROPPED $TOTAL / p | dc)
|
||||
echo "suridrop drop=$LOSS"
|
||||
0
salt/common/tools/packetloss.py
Normal file
0
salt/common/tools/packetloss.py
Normal file
Reference in New Issue
Block a user