Change EPS for Telegraf

This commit is contained in:
Mike Reeves
2021-04-19 13:29:46 -04:00
parent 54322f5e9d
commit 0c0edbaac8
13 changed files with 25 additions and 26 deletions

View File

@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# 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

View File

@@ -15,9 +15,9 @@
# You should have received a copy of the GNU General Public License
# 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)

View File

@@ -15,9 +15,9 @@
# You should have received a copy of the GNU General Public License
# 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'
EVENTCOUNTCURRENT="$(curl -s localhost:9600/_node/stats | jq '.events.in')"

View File

@@ -15,9 +15,9 @@
# You should have received a copy of the GNU General Public License
# 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'
EVENTCOUNTCURRENT="$(curl -s localhost:9600/_node/stats | jq '.pipelines.helix.events.out')"

View File

@@ -15,9 +15,9 @@
# You should have received a copy of the GNU General Public License
# 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'})

View File

@@ -15,9 +15,9 @@
# You should have received a copy of the GNU General Public License
# 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
OLDPCAP=$(find /host/nsm/pcap -type f -exec stat -c'%n %Z' {} + | sort | grep -v "\." | head -n 1 | awk {'print $2'})

View File

@@ -15,9 +15,9 @@
# You should have received a copy of the GNU General Public License
# 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
echo "raid $RAIDSTATUS"

View File

@@ -15,10 +15,9 @@
# You should have received a copy of the GNU General Public License
# 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}')
PARSED=$(redis-cli llen logstash:parsed | awk '{print $1}')

View File

@@ -14,9 +14,9 @@
#
# You should have received a copy of the GNU General Public License
# 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
SOSTATUSSTATUS=$(cat /var/log/sostatus/status.log)

View File

@@ -15,9 +15,9 @@
# You should have received a copy of the GNU General Public License
# 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
if [ -f "$TSFILE" ]; then

View File

@@ -16,9 +16,9 @@
# 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)
CHECKIT=$(echo $SURILOG | grep -o 'drop' | wc -l)

View File

@@ -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
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
WORKERS={{ salt['pillar.get']('sensor:zeek_lbprocs', salt['pillar.get']('sensor:zeek_pins') | length) }}

View File

@@ -17,9 +17,9 @@
# 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)
declare RESULT=($ZEEKLOG)