mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-07 17:52:46 +01:00
Merge pull request #332 from Security-Onion-Solutions/feature/helixeps
adding helix eps count for telegraf
This commit is contained in:
@@ -655,6 +655,7 @@
|
||||
"/scripts/checkfiles.sh",
|
||||
"/scripts/broloss.sh",
|
||||
"/scripts/oldpcap.sh",
|
||||
"/scripts/helixeps.sh",
|
||||
]
|
||||
data_format = "influx"
|
||||
{% endif %}
|
||||
|
||||
25
salt/common/telegraf/scripts/helixeps.sh
Normal file
25
salt/common/telegraf/scripts/helixeps.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
PREVCOUNTFILE='/tmp/helixevents.txt'
|
||||
EVENTCOUNTCURRENT="$(curl -s localhost:9600/_node/stats | jq '.pipelines.eval.events.out')"
|
||||
|
||||
if [ ! -z "$EVENTCOUNTCURRENT" ]; then
|
||||
|
||||
if [ -f "$PREVCOUNTFILE" ]; then
|
||||
EVENTCOUNTPREVIOUS=`cat $PREVCOUNTFILE`
|
||||
else
|
||||
echo "${EVENTCOUNTCURRENT}" > $PREVCOUNTFILE
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "${EVENTCOUNTCURRENT}" > $PREVCOUNTFILE
|
||||
EVENTS=$((EVENTCOUNTCURRENT - EVENTCOUNTPREVIOUS))
|
||||
if [ "$EVENTS" -lt 0 ]; then
|
||||
EVENTS=0
|
||||
fi
|
||||
|
||||
echo "helixeps eps=${EVENTS}"
|
||||
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user