From: Brian Flowers Date: Tue, 20 Sep 2016 04:22:07 +0000 (-0400) Subject: Fixed ssh hang in several plugins X-Git-Url: http://git.slightlycyberpunk.com%2C%20git.slightlycyberpunk.com/git/?a=commitdiff_plain;h=4245a747e32e3f20a31b19db6e979ce610234b44;p=bdsm.git Fixed ssh hang in several plugins --- diff --git a/bdsm.d/df.generic b/bdsm.d/df.generic index 5c628fd..a3a0af7 100755 --- a/bdsm.d/df.generic +++ b/bdsm.d/df.generic @@ -65,11 +65,11 @@ start() return 1 fi - ssh -q $HOSTNAME <> $OUTPATH + stdbuf -o0 echo "\$ts|$HOSTNAME|DISK-$LABEL-USED|\$df" >> $OUTPATH sleep $DELAY done & EOF diff --git a/bdsm.d/sensors.generic b/bdsm.d/sensors.generic index 3be2098..f50e663 100755 --- a/bdsm.d/sensors.generic +++ b/bdsm.d/sensors.generic @@ -61,10 +61,10 @@ start() return 1 fi - ssh -q $HOSTNAME </dev/null | \ + running=`ssh -q $HOSTNAME "cat /home/bdsm/.vmstat.pid 2>/dev/null | \ xargs ps -T | \ grep -v PID | \ wc -l"` 2>/dev/null @@ -69,7 +69,7 @@ start() fi # Check what options awk supports - if [ "`ssh -q $HOSTNAME \"echo | awk -W interactive '{print 1}' 2>&1 1>/dev/null\"`" != "" ]; then + if [ "`ssh -qn $HOSTNAME \"echo | awk -W interactive '{print 1}' 2>&1 1>/dev/null\"`" != "" ]; then awkopt="" else awkopt="-W interactive"