fi
ssh -q $HOSTNAME <<EOF
- nohup stdbuf -o0 while [ 1 ]; do
+ while [ 1 ]; do
df=`df --output=pcent "$DRIVE" | tail -1 | sed 's/[^0-9]//g'`
ts=`date '+%s'`
- echo "$ts|$HOSTNAME|DISK-$LABEL-USED|$df" >> $OUTPATH
+ nohup stdbuf -o0 echo "\$ts|$HOSTNAME|DISK-$LABEL-USED|\$df" >> $OUTPATH
sleep $DELAY
done &
EOF
fi
ssh -q $HOSTNAME <<EOF
- nohup stdbuf -o0 while [ 1 ]; do
+ while [ 1 ]; do
ts=`date '+%s'`
- sensors | \
+ nohup stdbuf -o0 sensors | \
sed 's/ */ /g' | \
sed 's/[(].*[)]//g' \
- | awk -v ts=$ts -v host=$HOSTNAME 'BEGIN {
+ | awk -v ts=\$ts -v host=\$HOSTNAME 'BEGIN {
line=1
} {
if($0 == "") {
info "Starting $type monitors on $host..."
functions=`cat /home/bdsm/.bdsm.conf.tmp | grep "$type:$host" | sed 's/.*{\(.*\)}.*/\1/'`
- ssh $host "cat /home/bdsm/out.fifo" > /home/bdsm/in.fifo &
+ ssh -q $host "cat /home/bdsm/out.fifo" > /home/bdsm/in.fifo &
echo $! > /home/bdsm/pids/$host.in
j=0
while read -u10 line; do
command=`echo $line | cut -d' ' -f1`
+ if [ "$command" == "" ]; then
+ continue
+ fi
args="`echo $line | cut -d' ' -f2-`"
if [ -f /home/bdsm/bdsm.d/$command.$type ]; then
/home/bdsm/bdsm.d/$command.$type start $host $args
j=0
echo $functions | tr ';' '\n' | sed 's/[(),]/ /g' | while read line; do
command=`echo $line | cut -d' ' -f1`
+ if [ "$command" == "" ]; then
+ continue
+ fi
args="`echo $line | cut -d' ' -f2-`"
if [ -f /home/bdsm/bdsm.d/$command.$type ]; then
/home/bdsm/bdsm.d/$command.$type stop $host $args