Don't wanna cut your efforts down but there might be a more simple solution:
Use sys_metrics :: http://www.conitec.net/beta/asys_metrics.htm
and the modi 0 and 1.
I hope this is what you are looking for, if not: sorry!