From 56c8e907002cb61622f711d46cd0e487b95b2a1c Mon Sep 17 00:00:00 2001 From: Daniel Reichelt Date: Fri, 16 Sep 2016 09:15:35 +0200 Subject: [PATCH] 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 --- admin_index.php | 9 +++++++++ lng/english.lng.php | 4 ++++ lng/german.lng.php | 4 ++++ templates/Sparkle/admin/index/index.tpl | 8 ++++++++ 4 files changed, 25 insertions(+) diff --git a/admin_index.php b/admin_index.php index baa1a2aa..a6247d05 100644 --- a/admin_index.php +++ b/admin_index.php @@ -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, '.', ''); diff --git a/lng/english.lng.php b/lng/english.lng.php index 76848bb3..e2fc7522 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -2041,3 +2041,7 @@ $lng['serversettings']['option_unavailable_websrv'] = '
Avail $lng['serversettings']['option_unavailable'] = '
Option not availble due to other settings.'; $lng['serversettings']['letsencryptacmeconf']['title'] = "Path to the acme.conf snippet"; $lng['serversettings']['letsencryptacmeconf']['description'] = "File name of the config snippet which allows the web server to serve the acme challenge."; + +// Added in froxlor 0.9.38 +$lng['admin']['hostname'] = 'Hostname'; +$lng['admin']['memory'] = 'Memory usage'; diff --git a/lng/german.lng.php b/lng/german.lng.php index 84c52f31..dd77baba 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1693,3 +1693,7 @@ $lng['serversettings']['option_unavailable_websrv'] = '
Nur v $lng['serversettings']['option_unavailable'] = '
Option aufgrund anderer Einstellungen nicht verfügbar.'; $lng['serversettings']['letsencryptacmeconf']['title'] = "Pfad zu acme.conf"; $lng['serversettings']['letsencryptacmeconf']['description'] = "Dateiname der Konfiguration, die dem Webserver erlaubt, die ACME-Challenges zu bedienen."; + +// Added in froxlor 0.9.38 +$lng['admin']['hostname'] = 'Hostname'; +$lng['admin']['memory'] = 'Speicherauslastung'; diff --git a/templates/Sparkle/admin/index/index.tpl b/templates/Sparkle/admin/index/index.tpl index efe000a4..0e8fa3de 100644 --- a/templates/Sparkle/admin/index/index.tpl +++ b/templates/Sparkle/admin/index/index.tpl @@ -211,6 +211,10 @@ $header + + {$lng['admin']['hostname']}: + {$system_hostname} + {$lng['admin']['serversoftware']}: {$_SERVER['SERVER_SOFTWARE']} @@ -227,6 +231,10 @@ $header {$lng['admin']['webserverinterface']}: $webserverinterface + + {$lng['admin']['memory']}: +
$memory
+ {$lng['admin']['sysload']}: $load