On Fri, 10 Aug 2012 13:49:30 +1000, John Kenyon wrote:
Hi Janos,

Found the problem:

file_get_contents(/var/piler/stat/cpu.stat): failed to open stream:
Permission denied in /var/www/html/controller/health/worker.php on
line 38

odd. Can you see anything in the php error log, syslog or apache error.log? Don't you have any php restrictions, eg. safe_mode, open_basedir, doc_root, etc?

permissions are:

ls -l /var/piler/stat/

-rw-r--r-- 1 piler piler 6 Aug 10 13:40 cpu.stat


What permissions do you have set?

the usual:

$ls -la /var/piler/stat/cpu.stat
-rw-r--r-- 1 piler users 6 Aug 10 10:10 /var/piler/stat/cpu.stat


If nothing helps, then edit controller/health/worker.php at set
the following around the 38th line:

      //$this->data['cpuinfo'] = 100 - (int)file_get_contents(CPUSTAT);
      $x = system("LC_ALL=C mpstat | tail -1 | awk '{print $11}'");
      $this->data['cpuinfo'] = 100 - (int)$x;

this way we won't read an external file, but rather let the script itself
run the mpstat command. Don't forget that for you you may need the $10
parameter.



Janos

Reply via email to