The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cPanel : General account information

Discussion in 'cPanel Developers' started by lvt, May 30, 2009.

  1. lvt

    lvt Well-Known Member

    Joined:
    May 23, 2009
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Reseller Owner
    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.
     
  2. lvt

    lvt Well-Known Member

    Joined:
    May 23, 2009
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    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 ?
     
  3. jhyland87

    jhyland87 Well-Known Member

    Joined:
    Dec 8, 2008
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    16
    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
     
  4. lvt

    lvt Well-Known Member

    Joined:
    May 23, 2009
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Reseller Owner
    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.
     
  5. lvt

    lvt Well-Known Member

    Joined:
    May 23, 2009
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    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 ?
     
  6. jhyland87

    jhyland87 Well-Known Member

    Joined:
    Dec 8, 2008
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    16
    Thats a good question, something id be interested in knowing as well
     
  7. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    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
     
  8. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    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.
     
  9. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    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.
     
  10. lvt

    lvt Well-Known Member

    Joined:
    May 23, 2009
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Reseller Owner
    Thanks David, you're always helpful.
     
Loading...

Share This Page