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.

API for getting server load

Discussion in 'cPanel Developers' started by SunShellNET, Mar 6, 2009.

  1. SunShellNET

    SunShellNET Active Member

    Joined:
    Feb 24, 2009
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    Hi

    Is there any API now for getting the server load ?

    Thanks
     
  2. 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, the loadavg function in the XML-API will give you the load average for the past one, five and fifteen minutes in XML format.
     
  3. lvt

    lvt Well-Known Member

    Joined:
    May 23, 2009
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Reseller Owner
    Can you please give an exemple with complete syntax ? Thanks.
     
  4. 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
    Sure, here's the raw URL you would pass to your server (where SERVER represents your server's hostname, any IP associated with the server or any domain associated with the server):

    https://SERVER:2087/xml-api/loadavg

    You can use Matt's PHP 5 class for the XML API if you wish to have easier access to this functionality via PHP 5: http://forums.cpanel.net/f42/xmlapi-php-class-111897.html
     
  5. lvt

    lvt Well-Known Member

    Joined:
    May 23, 2009
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Reseller Owner
    Thanks David, so it's only for WHM and not cPanel account, that's why it doesn't work for me :D
     
  6. 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
    Correct, this function is only available to those with WHM access.
     
Loading...

Share This Page