Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    56
    Hi

    Is there any API now for getting the server load ?

    Thanks
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,216
    Likes Received:
    10
    Trophy Points:
    313
    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:
    56
    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,216
    Likes Received:
    10
    Trophy Points:
    313
    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:
    56
    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,216
    Likes Received:
    10
    Trophy Points:
    313
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Correct, this function is only available to those with WHM access.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice