I'd like to use a PHP script running inside my VPS to monitor my bandwidth totals for the month. Short of scraping numbers out of the HyperVM page, is there any way I can interact with OpenVZ/HyperVM from within the VPS?
One option would be to use netstat to get interface statistics. Two potential problems are that the stats are in terms of packets rather than bytes (on Linux; Windows should be fine on this count) and they're measured from system start. The latter is what makes netstat a poor tool for the job, since you'd have to contend with both restarts (which produce too-low stats) and new months (which produce too-high stats, and are easier to deal with than restarts).