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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to get server's current memory usage using cPanel API?

Discussion in 'General Discussion' started by red whale, Jul 28, 2017.

  1. red whale

    red whale Registered

    Joined:
    Dec 21, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I have used LVEInfo::getUsage (cPanel API2 function) to get the server's historical memory usage. But I can't get the server's current memory usage. How can I do?
     
  2. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    599
    Likes Received:
    92
    Trophy Points:
    153
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Depends, how are you trying to obtain it? Only via the API or?

    The easiest way would be SSH using the command:

    Code:
    free -m
    but yeah would come down to the method in which you want to obtain it.
     
  3. red whale

    red whale Registered

    Joined:
    Dec 21, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hi,
    my server administrator doesn't allow me to use the command line. Besides, I can't read the file "/proc/lve/list", which can also get the usage information of system. It seems the file doesn't exist. So how can I get the current memory usage and other usage information without using command line or reading the file "/proc/lve/list"?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The "lvetop" utility provides the information you are seeking:

    CloudLinux Documentation

    However, it's not available without root access to the server (and shell access). There's no corresponding UAPI/cPanel API 2 function for this purpose. I recommend opening a feature request for it via:

    Submit A Feature Request

    Thank you.
     
Loading...

Share This Page