--- /dev/null
+TODO
+
+BUGFIXES:
+ - Fix sqlite3 logging -- needs to be globally writable
+ May require folder structure refactoring
+
+
+PLUGINS:
+ - Starting vmstat on monitor (but not www) echos SSH banner
+
+ REFACTORING:
+ - Folder structure
+ bin/bdsm
+ etc/bdsm.d/monitors
+ etc/bdsm.d/processors
+ etc/bdsm.d/bdsm.db
+ etc/bdsm.d/bdsm.conf
+ etc/bdsm.d/out.fifo
+ etc/bdsm.d/in.fifo
+ etc/bdsm.d/pids
+ etc/bdsm.d/errors.log
+ etc/bdsm.d/bdsm.log
+ - Move all pids to pid folder
+ - Add a generic function for killing a process and deleting the pid file
+ Then add checking for 'orphaned' pids
+ - Replace some of the /dev/null redirects with error logging
\ No newline at end of file
stop()
{
ssh $HOSTNAME 'kill `cat /home/bdsm/.df.pid`'
- ssh $HOSTNAME "rm /home/bdsm/.df.pid"
+ ssh $HOSTNAME 'rm /home/bdsm/.df.pid'
}
status()
awkopt="-W interactive"
fi
- ssh -q $HOSTNAME <<EOF
+ ssh -q $HOSTNAME 2>/dev/null <<EOF
nohup stdbuf -oL vmstat $vmopt $DELAY | awk $awkopt -v host=$HOSTNAME 'BEGIN {
OFS="|"
}
close("date '+%s'")
}' >> $OUTPATH 2>/home/bdsm/err.log &
EOF
- ssh -q $HOSTNAME "ps aux | \
+ ssh -q $HOSTNAME 2>/dev/null "ps aux | \
grep bdsm | \
grep vmstat | \
grep -v grep | \
stop()
{
- ssh $HOSTNAME "kill `cat /home/bdsm/.vmstat.pid`"
- ssh $HOSTNAME "rm /home/bdsm/.vmstat.pid"
+ ssh $HOSTNAME 'kill `cat /home/bdsm/.vmstat.pid`'
+ ssh $HOSTNAME 'rm /home/bdsm/.vmstat.pid'
}
status()
fi
done
+ # These should terminate once all writing processes are killed
+ # Might need some error handling here -- this command SHOULD always fail
+ # If the processes exist, something is wrong!
+ kill `cat /home/bdsm/pids/$host.in` 2>/dev/null
+ rm /home/bdsm/pids/$host.in
+
/home/bdsm/bdsm.d/$processor.processor stop
i=`expr $i + 1`