mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-10 03:02:58 +01:00
Common Module - Add Suricata PL tracker
This commit is contained in:
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"
|
||||
Reference in New Issue
Block a user