ssh -q $HOSTNAME <<EOF
while [ 1 ]; do
- df=`df --output=pcent "$DRIVE" | tail -1 | sed 's/[^0-9]//g'`
- ts=`date '+%s'`
+ df=\`df --output=pcent "$DRIVE" | tail -1 | sed 's/[^0-9]//g'\`
+ ts=\`date '+%s'\`
stdbuf -oL echo "\$ts|$HOSTNAME|DISK-$LABEL-USED|\$df"
sleep $DELAY
done >> $OUTPATH &
cat /home/bdsm/in.fifo | awk -F'|' '{ \
printf("INSERT INTO MEASUREMENTS(timestamp,host,attribute,value) \
- VALUES (%s,\"%s\", \"%s\", \"%s\"); COMMIT;\n",$1,$2, $3, $4) }' | \
+ VALUES (%s,\"%s\", \"%s\", \"%s\");\n",$1,$2, $3, $4) }' | \
sqlite3 bdsm.sqlite3 &
echo $! > /home/bdsm/.processor.pid
}
# VARIABLES
###############################################################################
-if [ -f "/home/bdsm/bdsm.d/$1.processor" ]; then
- processor="${1}"
+if [ -f "/home/bdsm/bdsm.d/$2.processor" ]; then
+ processor="${2}"
else
processor=""
fi