mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Bro - Add cron for checking PL
This commit is contained in:
@@ -629,6 +629,7 @@
|
|||||||
"/scripts/stenoloss.sh",
|
"/scripts/stenoloss.sh",
|
||||||
"/scripts/suriloss.sh",
|
"/scripts/suriloss.sh",
|
||||||
"/scripts/checkfiles.sh",
|
"/scripts/checkfiles.sh",
|
||||||
|
"/scripts/broloss.sh",
|
||||||
"/scripts/oldpcap.sh"
|
"/scripts/oldpcap.sh"
|
||||||
]
|
]
|
||||||
data_format = "influx"
|
data_format = "influx"
|
||||||
@@ -640,6 +641,7 @@
|
|||||||
"/scripts/stenoloss.sh",
|
"/scripts/stenoloss.sh",
|
||||||
"/scripts/suriloss.sh",
|
"/scripts/suriloss.sh",
|
||||||
"/scripts/checkfiles.sh",
|
"/scripts/checkfiles.sh",
|
||||||
|
"/scripts/broloss.sh",
|
||||||
"/scripts/oldpcap.sh"
|
"/scripts/oldpcap.sh"
|
||||||
]
|
]
|
||||||
data_format = "influx"
|
data_format = "influx"
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Get the data
|
BROLOG=$(tac /nsm/bro/logs/packetloss.log | head -2)
|
||||||
DROP=$(tac /var/log/stenographer/stenographer.log | grep -m1 drop | awk '{print $14}' | awk -F "=" '{print $2}')
|
declare RESULT=($BROLOG)
|
||||||
|
CURRENTDROP=${RESULT[3]}
|
||||||
echo "stenodrop drop=$DROP"
|
PASTDROP=${RESULT[9]}
|
||||||
|
DROPPED=$(($CURRENTDROP - $PASTDROP))
|
||||||
|
CURRENTPACKETS=${RESULT[5]}
|
||||||
|
PASTPACKETS=${RESULT[11]}
|
||||||
|
TOTAL=$(($CURRENTPACKETS - $PASTPACKETS))
|
||||||
|
echo "cd $CURRENTDROP pd $PASTDROP dr $DROPPED cp $CURRENTPACKETS pp $PASTPACKETS ttl $TOTAL"
|
||||||
|
LOSS=$(echo $DROPPED $TOTAL / p | dc)
|
||||||
|
echo "brodrop drop=$LOSS"
|
||||||
|
|||||||
Reference in New Issue
Block a user