display system hostname and some memory info on dashboard

hostname may be useful in situations where several froxlors are
reverse-proxied on a single webserver
This commit is contained in:
Daniel Reichelt
2016-09-16 09:15:35 +02:00
parent e9d438f8cf
commit 56c8e90700
4 changed files with 25 additions and 0 deletions

View File

@@ -144,6 +144,15 @@ if ($page == 'overview') {
$cron_last_runs = getCronjobsLastRun();
$outstanding_tasks = getOutstandingTasks();
$system_hostname = gethostname();
$meminfo= explode("\n", @file_get_contents("/proc/meminfo"));
$memory = "";
for ($i = 0; $i < sizeof($meminfo); ++$i) {
if (substr($meminfo[$i], 0, 3) === "Mem") {
$memory.= $meminfo[$i] . PHP_EOL;
}
}
if (function_exists('sys_getloadavg')) {
$loadArray = sys_getloadavg();
$load = number_format($loadArray[0], 2, '.', '') . " / " . number_format($loadArray[1], 2, '.', '') . " / " . number_format($loadArray[2], 2, '.', '');