Call functions like cPanel?
Hello.
I need to display those outputs on my Script:
(edit) cPanel Version (I have found it : /usr/local/cpanel/version)
Memory Used in %
Disk usage in % (Disk /dev/sda1 (/))
Those should show same as in cPanel when I check Server Status in procentage
I have only found how to show server load:
The output is like this:
Thank you!
echo substr(file_get_contents("/proc/loadavg"), 0, 14);The output is like this:
0.11 0.04 0.01Thank you!
-
You might find our API documentation helpful: https://api.docs.cpanel.net/ I believe you'll be able to retrieve the data you want with API calls.
0 -
Thank you for your answer but am not able to find it. I need something like: substr(file_get_contents("/proc/meminfo")); and to show: 19% and not the whole memory info. 0 -
Hello :) You may need to develop a custom script that takes the output from an API function and parses the data into an easy-to-read format. Here are some functions that may help you: https://api.docs.cpanel.net/whm/introduction Or, if it's only the memory output you are seeking, you could develop a script that puts the output from the "free -m" command in a better format. Thank you.
0
Please sign in to leave a comment.
Comments
3 comments