From: Brian Flowers Date: Tue, 20 Sep 2016 05:18:54 +0000 (-0400) Subject: Fixing pid logging in df/sensors plugins X-Git-Url: http://git.slightlycyberpunk.com%2C%20git.slightlycyberpunk.com/git/?a=commitdiff_plain;h=a0c5fe75b2cc6395e1051357e6b4a9bd8dc4ae85;p=bdsm.git Fixing pid logging in df/sensors plugins --- 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