Very well done sir...
I still experience wrong reported hash rate though.
My sgminer froze and reported 0.00 hashrate total and about 4Mh per card.
The reading at cgminermonitor.com though reported 16Mh (4 cards).
And that was for almost 24hours.
Ok, now I understand. In my opinion that it's sgminer fault that it gives 4Mh report per card.
However, now I am working on advanced notifications, where you could set up an alert when accepted shares do not increase - this would solve this issue.