From bb1d5fbc5e268782910f385b0088fdbbdc204006 Mon Sep 17 00:00:00 2001 From: Brian Flowers Date: Mon, 10 Oct 2016 17:20:47 -0400 Subject: [PATCH] Fixes to status and logging --- bdsm.d/df.generic | 4 ++-- bdsm.d/file.processor | 2 +- bdsm.d/sensors.generic | 4 ++-- bdsm.d/sqlite3.processor | 2 +- bdsm.d/vmstat.generic | 7 ++----- bdsm.sh | 5 ++--- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/bdsm.d/df.generic b/bdsm.d/df.generic index c68abd9..241ef5d 100755 --- a/bdsm.d/df.generic +++ b/bdsm.d/df.generic @@ -53,7 +53,7 @@ help() start() { running=`ssh -q $HOSTNAME "cat /home/bdsm/.df.pid 2>/dev/null | \ - xargs ps -T | \ + xargs ps -p 2>/dev/null | \ grep -v PID | \ wc -l"` 2>/dev/null @@ -88,7 +88,7 @@ stop() status() { running=`ssh $HOSTNAME "cat /home/bdsm/.df.pid 2>/dev/null | \ - xargs ps -T | \ + xargs ps -p 2>/dev/null | \ grep -v PID | \ wc -l"` diff --git a/bdsm.d/file.processor b/bdsm.d/file.processor index 778ae59..f4dd03f 100644 --- a/bdsm.d/file.processor +++ b/bdsm.d/file.processor @@ -54,7 +54,7 @@ stop() status() { running=`cat /home/bdsm/.processor.pid 2>/dev/null | \ - xargs ps -T | \ + xargs ps -p 2>/dev/null | \ grep -v PID | \ wc -l` diff --git a/bdsm.d/sensors.generic b/bdsm.d/sensors.generic index 85e7e4e..852ab1b 100755 --- a/bdsm.d/sensors.generic +++ b/bdsm.d/sensors.generic @@ -49,7 +49,7 @@ help() start() { running=`ssh -q $HOSTNAME "cat /home/bdsm/.sensors.pid 2>/dev/null | \ - xargs ps -T | \ + xargs ps -p 2>/dev/null | \ grep -v PID | \ wc -l"` 2>/dev/null @@ -100,7 +100,7 @@ stop() status() { running=`ssh $HOSTNAME "cat /home/bdsm/.sensors.pid 2>/dev/null | \ - xargs ps -T | \ + xargs ps -p 2>/dev/null | \ grep -v PID | \ wc -l"` diff --git a/bdsm.d/sqlite3.processor b/bdsm.d/sqlite3.processor index 076b0f4..f86e7a4 100644 --- a/bdsm.d/sqlite3.processor +++ b/bdsm.d/sqlite3.processor @@ -62,7 +62,7 @@ start() stop() { kill `cat /home/bdsm/.processor.pid` - rm /home/bdsm/.file-logger.pid + rm /home/bdsm/.processor.pid } status() diff --git a/bdsm.d/vmstat.generic b/bdsm.d/vmstat.generic index 8fa70bb..d3b37c3 100755 --- a/bdsm.d/vmstat.generic +++ b/bdsm.d/vmstat.generic @@ -49,7 +49,7 @@ help() start() { running=`ssh -q $HOSTNAME "cat /home/bdsm/.vmstat.pid 2>/dev/null | \ - xargs ps -T | \ + xargs ps -p 2>/dev/null | \ grep -v PID | \ wc -l"` 2>/dev/null @@ -126,13 +126,10 @@ stop() status() { running=`ssh $HOSTNAME "cat /home/bdsm/.vmstat.pid 2>/dev/null | \ - xargs ps -T | \ + xargs ps -p 2>/dev/null | \ grep -v PID | \ wc -l"` - if [ -z "$running" ]; then - running=0 - fi if [ $running -eq 0 ]; then echo "OFF" else diff --git a/bdsm.sh b/bdsm.sh index 126660e..12ed540 100755 --- a/bdsm.sh +++ b/bdsm.sh @@ -6,9 +6,8 @@ # # TODO: # 1) Continuing checks (confirm start/stop/status/config of all plugins) -# 2) Add 'logger' type and logger plugins -# Logger won't hold an SSH connection open -# A single host can be defined multiple times as different types +# 2) Fix stop -- doesn't stop df, doesn't stop remote sessions, doesn't stop processor +# # ) Plugins: # o) disk utilization - iostat # b) ram utilization - free or vmstat -- 1.8.3.1