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.

External account info/stats

Discussion in 'cPanel Developers' started by bulldogg597, Jul 15, 2007.

  1. bulldogg597

    bulldogg597 Registered

    Joined:
    Jul 15, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    are there any 3rd party scripts that can show cpanel account info externally, information such as

    Disk Space Usage
    MySQL Disk Space
    Disk space available
    Bandwidth (this month)

    at current i only know that you have to log into cpanel to view this info, is there anyway to view it externally without logging in
     
  2. bulldogg597

    bulldogg597 Registered

    Joined:
    Jul 15, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    anyone? (please :) )
     
  3. 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
    If you create a custom script using the XML API in conjunction with the XML API's support for API2 tags, you may be able to get the results you desire.

    Documentation at:
    http://www.cPanel.net/plugins/devel
     
  4. bulldogg597

    bulldogg597 Registered

    Joined:
    Jul 15, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    im not so good with xml of any kind, could you provide an example of what i would have to do?
     
  5. 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
    Well we actually don't use an XML RPC, we tried to keep things simple :). Essentially, all you have to do is call a special URL with some parameters to get information.

    For example, if you want to see all users' bandwidth usage, then navigate to:

    http://IP:2087/xml-api/showbw

    The returned result is in XML. It's up to you to use whatever utilities are available in the programming language you're using to actually process that XML, that's outside our realm of support :).

    All you have to do is code a script to access that URL. Now you can authenticate using user/pass or user/hash (preferred).

    There are many great examples in our XML API documentation. Of course, if you want to see some code in action, I have some sample code in this thread.
     
  6. bulldogg597

    bulldogg597 Registered

    Joined:
    Jul 15, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    when i did the user bandwith with my ip i got a blank page?

    this si the code from your other thread, could of questions

    $hash, how do i know my hash?
    $apiPath, how can i fugre out my apiPath? will it be the same for all hosts?, i cant access anythign like xml-api through ftp

    also, will i be able to do all this through a webhost cpanel, im using inmotionhosting

     
    #6 bulldogg597, Jul 16, 2007
    Last edited by a moderator: Sep 7, 2007
  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
    You will need reseller or root access to the WHM interface to make use of these APIs. If you don't have that level of access, you cannot use the APIs.

    In addition, the XML API only works on cPanel 11. If you're still on cPanel 10, don't attempt to use the XML API as it will not work.

    Your hash can be accessed via WHM, in the "Cluster/Remote Access" section - click on "Setup Remote Access Key" - viola, your hash!

    The API Path is the file you're calling.

    You're welcome to read the documentation... I promise it doesn't bite or have any uncomfortable side-effects.
     
  8. MACscr

    MACscr Well-Known Member

    Joined:
    Sep 30, 2003
    Messages:
    190
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    david,

    Will the API lists resellers usage as well? As in is it possible to get the resellers total amount of bandwiidth its clients have used?
     
  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
    You could always call listaccounts (owner would be the reseller under which that account was created), then cross-reference that with showbw.
     
  10. HostNine.Com

    HostNine.Com Member

    Joined:
    Sep 10, 2006
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Houston, TX
    Is it possible to use search with showbw like you can with listaccounts? That would be really useful so you can just get the bwusage for a single domain rather than the entire server.
     
  11. mike25

    mike25 Well-Known Member

    Joined:
    Aug 29, 2003
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Raleigh NC, USA
    This script does not appear to work. The hash is not sent or not applied. I have tried several servers and checked my hashes several times. A WHM login / password page is instead produded. Ports are open and basic connectivity is all ok. Does this script work for anyone else?
     
  12. 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
    Sorry about that, the code didn't include a user/hash combination. I have edited the code out of the previous post on this thread to avoid further confusion as people search for this unaware of the original string of threads on this topic.

    Here's a link to updated code that will not result in a WHM login page:

    http://forums.cpanel.net/showpost.php?p=322538&postcount=6
     
  13. mike25

    mike25 Well-Known Member

    Joined:
    Aug 29, 2003
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Raleigh NC, USA
    Great, thanks a bunch that is very helpful.
     
Loading...

Share This Page