mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Change EPS for Telegraf
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
THEGREP=$(ps -ef | grep $0 | grep -v grep)
|
THEGREP=$(ps -ef | grep $0 | grep -v $$ | grep -v grep)
|
||||||
|
|
||||||
if [ ! "$THEGREP" ]; then
|
if [ ! "$THEGREP" ]; then
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
THEGREP=$(ps -ef | grep $0 | grep -v grep)
|
THEGREP=$(ps -ef | grep $0 | grep -v $$ | grep -v grep)
|
||||||
|
|
||||||
if [ ! $THEGREP ]; then
|
if [ ! "$THEGREP" ]; then
|
||||||
|
|
||||||
FILES=$(ls -1x /host/nsm/faf/complete/ | wc -l)
|
FILES=$(ls -1x /host/nsm/faf/complete/ | wc -l)
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
THEGREP=$(ps -ef | grep $0 | grep -v grep)
|
THEGREP=$(ps -ef | grep $0 | grep -v $$ | grep -v grep)
|
||||||
|
|
||||||
if [ ! $THEGREP ]; then
|
if [ ! "$THEGREP" ]; then
|
||||||
|
|
||||||
PREVCOUNTFILE='/tmp/eps.txt'
|
PREVCOUNTFILE='/tmp/eps.txt'
|
||||||
EVENTCOUNTCURRENT="$(curl -s localhost:9600/_node/stats | jq '.events.in')"
|
EVENTCOUNTCURRENT="$(curl -s localhost:9600/_node/stats | jq '.events.in')"
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
THEGREP=$(ps -ef | grep $0 | grep -v grep)
|
THEGREP=$(ps -ef | grep $0 | grep -v $$ | grep -v grep)
|
||||||
|
|
||||||
if [ ! $THEGREP ]; then
|
if [ ! "$THEGREP" ]; then
|
||||||
|
|
||||||
PREVCOUNTFILE='/tmp/helixevents.txt'
|
PREVCOUNTFILE='/tmp/helixevents.txt'
|
||||||
EVENTCOUNTCURRENT="$(curl -s localhost:9600/_node/stats | jq '.pipelines.helix.events.out')"
|
EVENTCOUNTCURRENT="$(curl -s localhost:9600/_node/stats | jq '.pipelines.helix.events.out')"
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
THEGREP=$(ps -ef | grep $0 | grep -v grep)
|
THEGREP=$(ps -ef | grep $0 | grep -v $$ | grep -v grep)
|
||||||
|
|
||||||
if [ ! $THEGREP ]; then
|
if [ ! "$THEGREP" ]; then
|
||||||
|
|
||||||
INFLUXSIZE=$(du -s -k /host/nsm/influxdb | awk {'print $1'})
|
INFLUXSIZE=$(du -s -k /host/nsm/influxdb | awk {'print $1'})
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
THEGREP=$(ps -ef | grep $0 | grep -v grep)
|
THEGREP=$(ps -ef | grep $0 | grep -v $$ | grep -v grep)
|
||||||
|
|
||||||
if [ ! $THEGREP ]; then
|
if [ ! "$THEGREP" ]; then
|
||||||
|
|
||||||
# Get the data
|
# Get the data
|
||||||
OLDPCAP=$(find /host/nsm/pcap -type f -exec stat -c'%n %Z' {} + | sort | grep -v "\." | head -n 1 | awk {'print $2'})
|
OLDPCAP=$(find /host/nsm/pcap -type f -exec stat -c'%n %Z' {} + | sort | grep -v "\." | head -n 1 | awk {'print $2'})
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
THEGREP=$(ps -ef | grep $0 | grep -v grep)
|
THEGREP=$(ps -ef | grep $0 | grep -v $$ | grep -v grep)
|
||||||
|
|
||||||
if [ ! $THEGREP ]; then
|
if [ ! "$THEGREP" ]; then
|
||||||
|
|
||||||
if [ -f "$RAIDLOG" ]; then
|
if [ -f "$RAIDLOG" ]; then
|
||||||
echo "raid $RAIDSTATUS"
|
echo "raid $RAIDSTATUS"
|
||||||
|
|||||||
@@ -15,10 +15,9 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
THEGREP=$(ps -ef | grep $0 | grep -v $$ | grep -v grep)
|
||||||
|
|
||||||
THEGREP=$(ps -ef | grep $0 | grep -v grep)
|
if [ ! "$THEGREP" ]; then
|
||||||
|
|
||||||
if [ ! $THEGREP ]; then
|
|
||||||
|
|
||||||
UNPARSED=$(redis-cli llen logstash:unparsed | awk '{print $1}')
|
UNPARSED=$(redis-cli llen logstash:unparsed | awk '{print $1}')
|
||||||
PARSED=$(redis-cli llen logstash:parsed | awk '{print $1}')
|
PARSED=$(redis-cli llen logstash:parsed | awk '{print $1}')
|
||||||
|
|||||||
@@ -14,9 +14,9 @@
|
|||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
THEGREP=$(ps -ef | grep $0 | grep -v grep)
|
THEGREP=$(ps -ef | grep $0 | grep -v $$ | grep -v grep)
|
||||||
|
|
||||||
if [ ! $THEGREP ]; then
|
if [ ! "$THEGREP" ]; then
|
||||||
|
|
||||||
SOSTATUSLOG=/var/log/sostatus/status.log
|
SOSTATUSLOG=/var/log/sostatus/status.log
|
||||||
SOSTATUSSTATUS=$(cat /var/log/sostatus/status.log)
|
SOSTATUSSTATUS=$(cat /var/log/sostatus/status.log)
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
THEGREP=$(ps -ef | grep $0 | grep -v grep)
|
THEGREP=$(ps -ef | grep $0 | grep -v $$ | grep -v grep)
|
||||||
|
|
||||||
if [ ! $THEGREP ]; then
|
if [ ! "$THEGREP" ]; then
|
||||||
|
|
||||||
TSFILE=/var/log/telegraf/laststenodrop.log
|
TSFILE=/var/log/telegraf/laststenodrop.log
|
||||||
if [ -f "$TSFILE" ]; then
|
if [ -f "$TSFILE" ]; then
|
||||||
|
|||||||
@@ -16,9 +16,9 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
THEGREP=$(ps -ef | grep $0 | grep -v grep)
|
THEGREP=$(ps -ef | grep $0 | grep -v $$ | grep -v grep)
|
||||||
|
|
||||||
if [ ! $THEGREP ]; then
|
if [ ! "$THEGREP" ]; then
|
||||||
|
|
||||||
SURILOG=$(tac /var/log/suricata/stats.log | grep kernel | head -4)
|
SURILOG=$(tac /var/log/suricata/stats.log | grep kernel | head -4)
|
||||||
CHECKIT=$(echo $SURILOG | grep -o 'drop' | wc -l)
|
CHECKIT=$(echo $SURILOG | grep -o 'drop' | wc -l)
|
||||||
|
|||||||
@@ -18,9 +18,9 @@
|
|||||||
|
|
||||||
# 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
|
||||||
|
|
||||||
THEGREP=$(ps -ef | grep $0 | grep -v grep)
|
THEGREP=$(ps -ef | grep $0 | grep -v $$ | grep -v grep)
|
||||||
|
|
||||||
if [ ! $THEGREP ]; then
|
if [ ! "$THEGREP" ]; then
|
||||||
|
|
||||||
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) }}
|
||||||
|
|||||||
@@ -17,9 +17,9 @@
|
|||||||
|
|
||||||
# This script returns the packets dropped by Zeek, but it isn't a percentage. $LOSS * 100 would be the percentage
|
# This script returns the packets dropped by Zeek, but it isn't a percentage. $LOSS * 100 would be the percentage
|
||||||
|
|
||||||
THEGREP=$(ps -ef | grep $0 | grep -v grep)
|
THEGREP=$(ps -ef | grep $0 | grep -v $$ | grep -v grep)
|
||||||
|
|
||||||
if [ ! $THEGREP ]; then
|
if [ ! "$THEGREP" ]; then
|
||||||
|
|
||||||
ZEEKLOG=$(tac /host/nsm/zeek/logs/packetloss.log | head -2)
|
ZEEKLOG=$(tac /host/nsm/zeek/logs/packetloss.log | head -2)
|
||||||
declare RESULT=($ZEEKLOG)
|
declare RESULT=($ZEEKLOG)
|
||||||
|
|||||||
Reference in New Issue
Block a user