mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-07 09:42:46 +01:00
Update zeekcaptureloss.sh
This commit is contained in:
@@ -1,6 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# This script returns the average of all the workers average capture loss to telegraf / influxdb in influx format include nanosecond precision timestamp
|
# This script returns the average of all the workers average capture loss to telegraf / influxdb in influx format include nanosecond precision timestamp
|
||||||
|
|
||||||
|
APP=zeekloss
|
||||||
|
lf=/tmp/$APP-pidLockFile
|
||||||
|
# create empty lock file if none exists
|
||||||
|
cat /dev/null >> $lf
|
||||||
|
read lastPID < $lf
|
||||||
|
# if lastPID is not null and a process with that pid exists , exit
|
||||||
|
[ ! -z "$lastPID" -a -d /proc/$lastPID ] && exit
|
||||||
|
echo $$ > $lf
|
||||||
|
|
||||||
if [ -d "/host/nsm/zeek/spool/logger" ]; then
|
if [ -d "/host/nsm/zeek/spool/logger" ]; then
|
||||||
WORKERS={{ salt['pillar.get']('sensor:zeek_lbprocs', salt['pillar.get']('sensor:zeek_pins') | length) }}
|
WORKERS={{ salt['pillar.get']('sensor:zeek_lbprocs', salt['pillar.get']('sensor:zeek_pins') | length) }}
|
||||||
ZEEKLOG=/host/nsm/zeek/spool/logger/capture_loss.log
|
ZEEKLOG=/host/nsm/zeek/spool/logger/capture_loss.log
|
||||||
@@ -23,4 +32,4 @@ if [ -f "$ZEEKLOG" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo "$CURRENTTS" > $LASTCAPTURELOSSLOG
|
echo "$CURRENTTS" > $LASTCAPTURELOSSLOG
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user