summaryrefslogtreecommitdiffstats
path: root/modules-available/systemstatus/page.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/systemstatus/page.inc.php')
-rw-r--r--modules-available/systemstatus/page.inc.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules-available/systemstatus/page.inc.php b/modules-available/systemstatus/page.inc.php
index 238537d8..b0f968da 100644
--- a/modules-available/systemstatus/page.inc.php
+++ b/modules-available/systemstatus/page.inc.php
@@ -153,14 +153,19 @@ class Page_SystemStatus extends Page
$cpuInfo = file_get_contents('/proc/cpuinfo');
$uptime = file_get_contents('/proc/uptime');
$cpuCount = preg_match_all('/\bprocessor\s/', $cpuInfo, $out);
- //$cpuCount = count($out);
+ $file = file_get_contents('/usr/lib/os-release');
+ if (preg_match_all('/^(\w+)="?(.*?)"?$/m', $file, $out)) {
+ $out = array_combine($out[1], $out[2]);
+ }
$data = array(
'cpuCount' => $cpuCount,
'memTotal' => '???',
'memFree' => '???',
'swapTotal' => '???',
'swapUsed' => '???',
- 'uptime' => '???'
+ 'uptime' => '???',
+ 'kernel' => php_uname('r'),
+ 'distribution' => $out['PRETTY_NAME'] ?? (($out['NAME'] ?? '???') . ' ' . ($out['VERSION'] ?? '???')),
);
if (preg_match('/^(\d+)\D/', $uptime, $out)) {
$data['uptime'] = floor($out[1] / 86400) . ' ' . Dictionary::translate('lang_days') . ', ' . floor(($out[1] % 86400) / 3600) . ' ' . Dictionary::translate('lang_hours');