Forum Moderators: DixonJones

Message Too Old, No Replies

Usage stats of my virtual hosted domains

Monthly bandwidth and disk usage figures needed.

         

niceLAguy

5:44 pm on Jan 12, 2003 (gmt 0)

10+ Year Member



On the first day of every month I want the following numbers for every virtual domain I host (including my own) for the prior month.

1. I want to know the average disk usage (in MB) of every virtual domain I host (including mine).
2. I want to know the total bandwidth consumption of every virtual domain I host (including mine).
3. I want to get the numbers and write them into a file that PHP can read so I can bill customers by actual disk usage and bandwidth consumption, so I can get myself out of the "plan wars."

These numbers are available manually via CPanel/WebHostManager when you either list accounts (disk usage) or view bandwidth, but not through the API. My hosting provider also has Analog and Webalizer installed, but I have no idea if one can induce either of them to get this information.

An extra-nice plus would be an additional breakdown by subdomains, if any of the virtual domains are using any.

Brett_Tabke

4:57 am on Jan 13, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Welcome to the board.

It all depends upon what is being thrown into your log files. Most will include the domain name, and thus a log file analyzer can strip them out by domains.

niceLAguy

6:15 am on Jan 13, 2003 (gmt 0)

10+ Year Member



Thanks for the welcome. This site sure seems to have real information. I have found out a few things today:

You can call WebHostManager's functions from a URL or a script. For example, to call up the list of accounts (which shows the disk quote and current usage): [userid:password@ip.of.cpanel.whm:2086...]
--- or to retrieve the bandwidth figures: [userid:password@ip.of.cpanel.whm:2086...] (m=number of month 1-12; yyyy=2002,2003, etc.)

NOW ... the big difficulty is parsing the HTML to extract the numbers. So far, I've not found any way that looks "easy" at all ... and I could really use some suggestions.

Brett_Tabke

11:10 am on Jan 14, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Sounds like such a custom setup, that you'd have to go at the host to figure out just what they are running. There has to be a way to pull out the raw log files.

niceLAguy

2:18 am on Jan 15, 2003 (gmt 0)

10+ Year Member



Ah indeed, as I found out today. I have access to my domain account's logs, so I guess I'm off into virtual host land to figure out how Analog works. I printed the entire manual and will start with that. Any suggestions or short-cuts are welcome.

niceLAguy

5:20 am on Jan 16, 2003 (gmt 0)

10+ Year Member



Well ... what a configuration nightmare! I'm so confused and overwhelmed I'm not sure where to start. Does anyone have an analog.cfg for virtual hosted domains that actually works so I can see how the configuration is set-up? I would really appreciate your sharing it with me. I suggest you edit your dmain-secific information to generics like 'mydomain.com' or something.

niceLAguy

6:24 pm on Jan 19, 2003 (gmt 0)

10+ Year Member



The ISP is now providing the raw logs for all of the domains I need. It's starting to appear that the easy solution is to download them to my machine, process them, and post the results back on my site for inclusion by the billing package.