WHMCS Server Check not working
  1. Forums
  2. CloudLinux and Control Panels
  3. CloudLinux and cPanel
  1. Steve Venter
  2. 10.09.2010
  3.  Subscribe via email
WHMCS provides a script so that you can check the status of all the servers in your network. This script (pasted below) works fine on any server (CentOS, Ubuntu, Debian etc), except those running cloudlinux. It displays the load as 0.00 no matter what the actual load oif the server is.

Is there a way to adapt the script to correctly report the load of servers running CloudLinux?

This file can be uploaded to each of your linux web servers in order to
display current load and uptime statistics for the server in the Server
Status page of the WHMCS Client Area and Admin Area Homepage



if (ini_get(\'disable_functions\')) {


if ($action==\"phpinfo\") {
Uncoment the line below to allow users to view PHP Info for your
server. This potentially allows access to information a malicious
user could use to find weaknesses in your server.
} else {
if (in_array(\'exec\',$disabled_funcs)) {
$load=explode(\' \',$load);
} else {
$reguptime=trim(ex ec(\"uptime\"));
if ($reguptime) {
if (preg_match(\"/, *(\\d) (users?), .*: (.*), (.*), (.*)/\",$reguptime,$uptime)) {
if (in_array(\'shell_exec\',$disabled_funcs)) {
$uptime=substr($uptime_text,0,strpos($uptime_text,\" \"));
} else {
$uptime=shell_ex ec(\"cut -d. -f1 /proc/uptime\");
$phpver=phpver sion();
$zendver=zend_ver sion();
echo \"<load>$loadnow</load>\\n\";
echo \"<uptime>$days Days $hours:$mins:$secs</uptime>\\n\";
echo \"<phpver>$phpver</phpver>\\n\";
echo \"<mysqlver>$mysqlver</mysqlver>\\n\";
echo \"<zendver>$zendver</zendver>\\n\";

Rate this post:
  1. 10.09.2010 13:09:12
  2. # 1
kernow Accepted Answer
Posts: 72
Joined: 06.08.2010
If you run \"top\" from the cli you will see it shows only a fraction of the resources being actually used, so WHMCS isn\'t going to give you an accurate picture either. See the link below for why Load average
  1. 10.09.2010 13:09:00
  2. # 2
Steve Venter Accepted Answer
Posts: 28
Joined: 24.06.2010
Thank you - that\'s very interesting. So then, what is the best way to monitor your cloudlinux server? How do you know if it is running out of resources? :?: apart from staring at \"top\" the whole time?
  • Page :
  • 1

There are no replies made for this post yet.
Be one of the first to reply to this post!
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,zip,rar,pdf
• Insert • Remove Upload Files (Maximum File Size: 2 MB)
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.