cPanel : General account information

lvt

Well-Known Member
May 23, 2009
49
0
56
cPanel Access Level
Reseller Owner
I need help to display the following information just like cPanel does :

Disk Usage : 48.12/300 MB
Bandwidth : 31.79/3000.00 MB
Subdomains : 0/100
Parked Domains : 0/0
Addon Domains : 0/0
MySQL : 4/100
MySQL Disk Space : 1.16/251.88 MB
Email Accounts : 2/100
Email Forwarders : 5/unlimited
Auto-Responders : 0/unlimited
Email Filters : 0/unlimited
FTP Accounts : 1/100
For now I've figured out some information using StarsBar function

Email Accounts : 2/100
FTP Accounts : 1/100
MySQL : 4/100

Please help me with the other account information, especially Bandwidth & Disk usage.

Thanks.
 

lvt

Well-Known Member
May 23, 2009
49
0
56
cPanel Access Level
Reseller Owner
To my knowledge, Bandwidth & Disk usage can only obtain by using WHM "showbw" & "accountsummary" functions, can it be done via cPanel API without using WHM username / password ?
 

jhyland87

Well-Known Member
Dec 8, 2008
153
0
66
I am not sure about that, but I wouldnt doubt it. as of now, my script grabs it out of the clients account with the clients pw
 

lvt

Well-Known Member
May 23, 2009
49
0
56
cPanel Access Level
Reseller Owner
I am not sure about that, but I wouldnt doubt it. as of now, my script grabs it out of the clients account with the clients pw
Are you using cPanel API or other scripts ?

I modified a PHP script and put it in one of my website, this script will receive queries from other websites then grab XML data from WHM and finally return this data to the websites that request it. For the moment it's my only solution (tested succesfully) because I have several WHM and I don't want to put WHM accesskey manually in every script installed on the websites (imagine if I change the accesskey there will be lot of works).

But the solution only works for the websites hosted by me, if the websites are with other resellers it will not work because I don't have their WHM accesskey, so if it can be done with cPanel's API that's great.
 

lvt

Well-Known Member
May 23, 2009
49
0
56
cPanel Access Level
Reseller Owner
Another question : does Mysql databases share the same disk space with the website ? If not how to grab the information about its disk usage ?
 

jhyland87

Well-Known Member
Dec 8, 2008
153
0
66
Another question : does Mysql databases share the same disk space with the website ? If not how to grab the information about its disk usage ?
Thats a good question, something id be interested in knowing as well
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
I need help to display the following information just like cPanel does :



For now I've figured out some information using StarsBar function

Email Accounts : 2/100
FTP Accounts : 1/100
MySQL : 4/100

Please help me with the other account information, especially Bandwidth & Disk usage.

Thanks.
Here's a related thread:

http://forums.cpanel.net/f42/script-see-info-cpanel-111697.html

For Bandwidth usage and Disk Usage, you would use these parameters in your series of piped arguments (read the thread and it'll make more sense):

Code:
diskusage|bandwidthusage
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
To my knowledge, Bandwidth & Disk usage can only obtain by using WHM "showbw" & "accountsummary" functions, can it be done via cPanel API without using WHM username / password ?
Yes, use the API call I mentioned above. You can call the XML API for the cPanel account, just use the cPanel user's credentials to authenticate and use port 2083 (port 2082 if using plain-text HTTP) instead of ports 2087, 2086.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
Another question : does Mysql databases share the same disk space with the website ? If not how to grab the information about its disk usage ?
As of writing, database disk space is not always counted as part of the user's disk consumption. This will be resolved fully in cPanel/WHM 11.25. However, there is no built-in way for retrieving the disk space consumed only by databases via our APIs at this time.