From a0c5fe75b2cc6395e1051357e6b4a9bd8dc4ae85 Mon Sep 17 00:00:00 2001 From: Brian Flowers Date: Tue, 20 Sep 2016 01:18:54 -0400 Subject: [PATCH] Fixing pid logging in df/sensors plugins --- bdsm.d/df.generic | 13 ++++--------- bdsm.d/sensors.generic | 11 +++-------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/bdsm.d/df.generic b/bdsm.d/df.generic index a3a0af7..cec9da9 100755 --- a/bdsm.d/df.generic +++ b/bdsm.d/df.generic @@ -65,20 +65,15 @@ start() return 1 fi - ssh -qn $HOSTNAME <> $OUTPATH + stdbuf -o0 echo "\$ts|$HOSTNAME|DISK-$LABEL-USED|\$df" sleep $DELAY - done & + done >> $OUTPATH & + echo \$! >/home/bdsm/.df.pid EOF - ssh -q $HOSTNAME "ps aux | \ - grep bdsm | \ - grep df | \ - grep -v grep | \ - awk '{print \$2}' \ - > /home/bdsm/.df.pid &" else echo "Already Running" fi diff --git a/bdsm.d/sensors.generic b/bdsm.d/sensors.generic index f50e663..6dd9ef1 100755 --- a/bdsm.d/sensors.generic +++ b/bdsm.d/sensors.generic @@ -61,7 +61,7 @@ start() return 1 fi - ssh -qn $HOSTNAME <> $OUTPATH & + echo \$! > /home/bdsm/.sensors.pid EOF - ssh -q $HOSTNAME "ps aux | \ - grep bdsm | \ - grep sensors | \ - grep -v grep | \ - awk '{print \$2}' \ - > /home/bdsm/.sensors.pid &" else echo "Already Running" fi -- 1.8.3.1