Forum Moderators: DixonJones
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.
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.