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

red whale

Registered
Dec 21, 2015
4
0
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?
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
160
168
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.
 

red whale

Registered
Dec 21, 2015
4
0
1
cPanel Access Level
Website Owner
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.
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"?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
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.