From 4245a747e32e3f20a31b19db6e979ce610234b44 Mon Sep 17 00:00:00 2001 From: Brian Flowers Date: Tue, 20 Sep 2016 00:22:07 -0400 Subject: [PATCH] Fixed ssh hang in several plugins --- bdsm.d/df.generic | 4 ++-- bdsm.d/sensors.generic | 4 ++-- bdsm.d/vmstat.generic | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) 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" -- 1.8.3.1