+ Reply to Thread
Results 1 to 4 of 4

Thread: Bandwidth stats from inside VPS?

  1. #1
    Mr. DOS is offline x10 Sophmore Mr. DOS is an unknown quantity at this point
    Join Date
    Oct 2009
    Location
    Nova Scotia, Canada
    Posts
    228

    Bandwidth stats from inside VPS?

    Hi,

    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?

    --- Mr. DOS
    I've written a couple articles on automatic application of AlphaImageLoader in IE6 using nothing but IE6-specific CSS rules.

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Bandwidth stats from inside 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).

    There are also many fine bandwidth monitoring tools for Linux ([2]) or Windows.
    Last edited by misson; 12-06-2009 at 08:46 AM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  3. #3
    Mr. DOS is offline x10 Sophmore Mr. DOS is an unknown quantity at this point
    Join Date
    Oct 2009
    Location
    Nova Scotia, Canada
    Posts
    228

    Re: Bandwidth stats from inside VPS?

    Yes, I'm aware of that option and the problems associated with it, which are why I'd like to directly retrieve what HyperVM says I've used.

    I will use something like that if no other method can be found, though.

    --- Mr. DOS
    I've written a couple articles on automatic application of AlphaImageLoader in IE6 using nothing but IE6-specific CSS rules.

  4. #4
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Bandwidth stats from inside VPS?

    HyperVM provides a web API, though I'm not certain if the name ("Traffic") you see on the main panel is the resource name used in the API.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. Bandwidth Explained - Web Hosting Guide
    By dWhite in forum Tutorials
    Replies: 1
    Last Post: 02-05-2009, 07:26 PM
  2. BandWidth Explained
    By teclanka in forum Tutorials
    Replies: 9
    Last Post: 10-13-2008, 07:47 AM
  3. Bandwidth exceeded?
    By swirly in forum Free Hosting
    Replies: 4
    Last Post: 10-18-2006, 12:04 PM
  4. How accurate are the cPanel stats?
    By saachi in forum Free Hosting
    Replies: 0
    Last Post: 09-19-2005, 05:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers